From e7ef863f2d276f1608cfe1d30472d3b1e9115644 Mon Sep 17 00:00:00 2001 From: zepumph Date: Mon, 18 Nov 2019 14:43:40 -0900 Subject: [PATCH] constrain ruler to above controls, https://github.com/phetsims/gravity-force-lab/issues/104 --- js/gravity-force-lab/view/GravityForceLabScreenView.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/gravity-force-lab/view/GravityForceLabScreenView.js b/js/gravity-force-lab/view/GravityForceLabScreenView.js index 7bd75af0..8d54ecd2 100644 --- a/js/gravity-force-lab/view/GravityForceLabScreenView.js +++ b/js/gravity-force-lab/view/GravityForceLabScreenView.js @@ -267,11 +267,10 @@ define( require => { modelViewTransform, rulerRegionPositions, positionDescriber ); // ruler drag bounds (in model coordinate frame) - assumes a single point scale inverted Y mapping - const halfModelHeight = modelViewTransform.viewToModelDeltaY( this.layoutBounds.height / 2 ); const minX = model.leftObjectBoundary; - const minY = halfModelHeight; // bottom bound because Y is inverted + const minY = modelViewTransform.viewToModelY( massControl2.top + 10 ); // bottom bound because Y is inverted const maxX = model.rightObjectBoundary; - const maxY = -halfModelHeight; // top bound because Y is inverted + const maxY = -modelViewTransform.viewToModelDeltaY( this.layoutBounds.height / 2 ); // top bound because Y is inverted // @private - added to object for animation stepping const gravityForceLabRuler = new ISLCRulerNode(