Skip to content

Commit b47531c

Browse files
committed
clean up dialog layoutStrategy, #104
Signed-off-by: Chris Malley <[email protected]>
1 parent 5e2ef7f commit b47531c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

js/solveit/view/SolveItSceneNode.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,14 @@ define( function( require ) {
273273
layoutStrategy: function( dialog, simBounds, screenBounds, scale ) {
274274

275275
// center horizontally on the screen
276-
var centerX = simBounds.center.times( 1 / scale ).x;
276+
var screenCenterX = simBounds.center.times( 1 / scale ).x;
277277

278278
// top of dialog below equationPanel, so the solution is not obscured
279-
var centerTop = self.localToGlobalPoint( new Vector2( equationPanel.centerX, equationPanel.bottom + 10 ) ).times( 1 / scale );
279+
var localCenterTop = new Vector2( equationPanel.centerX, equationPanel.bottom + 10 );
280+
var globalCenterTop = self.localToGlobalPoint( localCenterTop ).times( 1 / scale );
280281

281-
dialog.centerX = centerX;
282-
dialog.top = centerTop.y;
282+
dialog.centerX = screenCenterX;
283+
dialog.top = globalCenterTop.y;
283284
},
284285

285286
// 'Keep Going' hides the dialog

0 commit comments

Comments
 (0)