Skip to content

Commit

Permalink
Adjust LightScreenNode dimensions, see #315
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 15, 2019
1 parent fbf8b43 commit b3a5cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/common/WaveInterferenceConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ define( require => {
MAX_AMPLITUDE_TO_PLOT_ON_RIGHT: 2.14,

// Size of a cell in view coordinates
CELL_WIDTH: 10,
CELL_WIDTH: Util.roundSymmetric( 10 / CALIBRATION_SCALE ),

// lineJoin for the graph and the surface of the water
CHART_LINE_JOIN: 'round',
Expand Down
6 changes: 4 additions & 2 deletions js/common/view/LightScreenNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ define( require => {
const WaveInterferenceUtils = require( 'WAVE_INTERFERENCE/common/WaveInterferenceUtils' );

// constants
const CELL_WIDTH = WaveInterferenceConstants.CELL_WIDTH;
const CANVAS_WIDTH = 100;

// This chooses the saturation point for the screen, as well as the "thinness" of the minima
Expand All @@ -44,6 +43,9 @@ define( require => {
}, options );
super( options );

// @private - for the vertical scale factor
this.latticeCanvasBounds = latticeCanvasBounds;

// @private
this.lattice = lattice;

Expand Down Expand Up @@ -137,7 +139,7 @@ define( require => {

// draw the sub-canvas to the rendering context at the appropriate scale
context.save();
context.transform( CELL_WIDTH * 10, 0, 0, CELL_WIDTH, 0, 0 );
context.transform( 100, 0, 0, this.latticeCanvasBounds.height / this.lattice.visibleBounds.height, 0, 0 );
context.drawImage( this.imageDataRenderer.canvas, 0, 0 );
context.restore();
}
Expand Down

0 comments on commit b3a5cb2

Please sign in to comment.