Skip to content

Commit

Permalink
1.3 patch for #124
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 14, 2019
1 parent 317f26a commit 6d438ae
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
11 changes: 9 additions & 2 deletions js/common/GLConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ define( function( require ) {
X_AXIS_RANGE: new Range( -10, 10 ),
Y_AXIS_RANGE: new Range( -10, 10 ),
INTERACTIVE_EQUATION_FONT_SIZE: 34,
PICKER_TOUCH_AREA_X_DILATION: 30,
MANIPULATOR_RADIUS: 0.425,
SCREEN_X_MARGIN: 40,
SCREEN_Y_MARGIN: 20,
RESET_ALL_BUTTON_SCALE: 1.32,
PATTERN_0VALUE_EQUALS_1VALUE: '{0} ' + MathSymbols.EQUAL_TO + ' {1}', // i18n not required, used for e.g. x = 5
EQUATION_FONT_WEIGHT: 'bold'
EQUATION_FONT_WEIGHT: 'bold',

// see https://github.com/phetsims/graphing-lines/issues/124
PICKER_OPTIONS: {
touchAreaXDilation: 26,
touchAreaYDilation: 4,
mouseAreaXDilation: 0,
mouseAreaYDilation: 4
}
};

graphingLines.register( 'GLConstants', GLConstants );
Expand Down
5 changes: 2 additions & 3 deletions js/common/view/picker/CoordinatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ define( function( require ) {
*/
function CoordinatePicker( a1Property, b1Property, a2Property, b2Property, rangeProperty, options ) {

options = _.extend( {
color: GLColors.POINT_X1_Y1,
touchAreaXDilation: GLConstants.PICKER_TOUCH_AREA_X_DILATION
options = _.extend( {}, GLConstants.PICKER_OPTIONS, {
color: GLColors.POINT_X1_Y1
}, options );

// computes value when 'up' button is pressed
Expand Down
5 changes: 2 additions & 3 deletions js/common/view/picker/SlopePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ define( function( require ) {
*/
function SlopePicker( variableComponentProperty, fixedComponentProperty, variableRangeProperty, options ) {

options = _.extend( {
color: GLColors.SLOPE,
touchAreaXDilation: GLConstants.PICKER_TOUCH_AREA_X_DILATION
options = _.extend( {}, GLConstants.PICKER_OPTIONS, {
color: GLColors.SLOPE
}, options );

// 'up' function, skips over undefined line condition (slope=0/0) - not changeable by clients
Expand Down
16 changes: 8 additions & 8 deletions js/pointslope/view/PointSlopeEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ define( function( require ) {
var yMinusNode = new MinusNode( _.extend( { size: self.operatorLineSize }, staticOptions ) );
var y1Node;
if ( options.interactivePoint ) {
y1Node = new NumberPicker( y1Property, options.y1RangeProperty,
{ color: GLColors.POINT_X1_Y1, font: interactiveFont, touchAreaXDilation: 30 } );
y1Node = new NumberPicker( y1Property, options.y1RangeProperty, _.extend( {}, GLConstants.PICKER_OPTIONS, {
color: GLColors.POINT_X1_Y1,
font: interactiveFont
} ) );
}
else {
y1Node = new DynamicValueNode( y1Property, _.extend( { absoluteValue: true }, staticOptions ) );
Expand All @@ -135,12 +137,10 @@ define( function( require ) {
var xMinusNode = new MinusNode( _.extend( { size: self.operatorLineSize }, staticOptions ) );
var x1Node;
if ( options.interactivePoint ) {
x1Node = new NumberPicker( x1Property, options.x1RangeProperty,
{
color: GLColors.POINT_X1_Y1,
font: interactiveFont,
touchAreaXDilation: GLConstants.PICKER_TOUCH_AREA_X_DILATION
} );
x1Node = new NumberPicker( x1Property, options.x1RangeProperty, _.extend( {}, GLConstants.PICKER_OPTIONS, {
color: GLColors.POINT_X1_Y1,
font: interactiveFont
} ) );
}
else {
x1Node = new DynamicValueNode( x1Property, _.extend( { absoluteValue: true }, staticOptions ) );
Expand Down
7 changes: 3 additions & 4 deletions js/slopeintercept/view/SlopeInterceptEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ define( function( require ) {
var yInterceptNumeratorNode; // also used for integer values
if ( options.interactiveIntercept ) {
yInterceptNumeratorNode = new NumberPicker( yInterceptProperty, options.yInterceptRangeProperty,
{
_.extend( {}, GLConstants.PICKER_OPTIONS, {
color: GLColors.INTERCEPT,
font: interactiveFont,
touchAreaXDilation: GLConstants.PICKER_TOUCH_AREA_X_DILATION
} );
font: interactiveFont
} ) );
}
else {
yInterceptNumeratorNode = new DynamicValueNode( yInterceptNumeratorProperty, _.extend( { absoluteValue: true }, staticOptions ) );
Expand Down

0 comments on commit 6d438ae

Please sign in to comment.