Skip to content

Commit

Permalink
Make probe on tracer tool draggable, also update doc, see #141
Browse files Browse the repository at this point in the history
  • Loading branch information
andrealin committed Aug 15, 2017
1 parent 7af73b9 commit c59e67a
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions js/common/view/TracerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,20 @@ define( function( require ) {
// of the screen
var dragBoundsShift = -TRACER_CONTENT_WIDTH / 2 + RIGHTSIDE_PADDING;

// @public Should be added as a listener by our parent when the time is right
// crosshair view
var crosshairShape = new Shape()
.moveTo( -CIRCLE_AROUND_CROSSHAIR_RADIUS, 0 )
.lineTo( CIRCLE_AROUND_CROSSHAIR_RADIUS, 0 )
.moveTo( 0, -CIRCLE_AROUND_CROSSHAIR_RADIUS )
.lineTo( 0, CIRCLE_AROUND_CROSSHAIR_RADIUS );

var crosshair = new Path( crosshairShape, { stroke: 'black' } );
var circle = new Circle( CIRCLE_AROUND_CROSSHAIR_RADIUS, { lineWidth: 2, stroke: 'black', fill: TRANSPARENT_WHITE, cursor: 'pointer' } );

// Create the base of the crosshair
var crosshairMount = new Rectangle( 0, 0, 0.4 * CIRCLE_AROUND_CROSSHAIR_RADIUS, 0.4 * CIRCLE_AROUND_CROSSHAIR_RADIUS, { fill: 'gray' } );

// @public so events can be forwarded to it by ToolboxPanel
this.movableDragHandler = new MovableDragHandler( tracer.positionProperty, {
modelViewTransform: transformProperty.get(),
dragBounds: screenView.visibleBoundsProperty.get().shiftedX( dragBoundsShift ),
Expand All @@ -122,20 +135,8 @@ define( function( require ) {

// When dragging, move the tracer tool
rectangle.addInputListener( this.movableDragHandler );
circle.addInputListener( this.movableDragHandler );

// crosshair view
var crosshairShape = new Shape()
.moveTo( -CIRCLE_AROUND_CROSSHAIR_RADIUS, 0 )
.lineTo( CIRCLE_AROUND_CROSSHAIR_RADIUS, 0 )
.moveTo( 0, -CIRCLE_AROUND_CROSSHAIR_RADIUS )
.lineTo( 0, CIRCLE_AROUND_CROSSHAIR_RADIUS );

var crosshair = new Path( crosshairShape, { stroke: 'black' } );
var circle = new Circle( CIRCLE_AROUND_CROSSHAIR_RADIUS, { lineWidth: 2, stroke: 'black', fill: TRANSPARENT_WHITE } );

// Create the base of the crosshair
var crosshairMount = new Rectangle( 0, 0, 0.4 * CIRCLE_AROUND_CROSSHAIR_RADIUS, 0.4 * CIRCLE_AROUND_CROSSHAIR_RADIUS, { fill: 'gray' } );

// label and values readouts
var timeReadoutProperty = new Property( '-' );
var rangeReadoutProperty = new Property( '-' );
Expand Down

0 comments on commit c59e67a

Please sign in to comment.