Skip to content

Commit

Permalink
correct a visibleProperty that was accidentally passed to the wrong N…
Browse files Browse the repository at this point in the history
…ode, see #398
  • Loading branch information
jessegreenberg committed Mar 21, 2023
1 parent c83047a commit f4594e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/quadrilateral/view/QuadrilateralVertexNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { VertexLabelToProposedPositionMap } from '../model/QuadrilateralShapeMod
const LABEL_TEXT_FONT = new PhetFont( { size: 16, weight: 'bold' } );

type SelfOptions = EmptySelfOptions;
type VertexNodeOptions = SelfOptions & StrictOmit<QuadrilateralMovableNodeOptions, 'grabbedSound' | 'visibleProperty'>;
type VertexNodeOptions = SelfOptions & StrictOmit<QuadrilateralMovableNodeOptions, 'grabbedSound'>;

// Reusable map that saves proposed vertex positions, to avoid excessive garbage.
const scratchLabelToPositionMap: VertexLabelToProposedPositionMap = new Map();
Expand All @@ -42,8 +42,7 @@ export default class QuadrilateralVertexNode extends QuadrilateralMovableNode {
public constructor( vertex: QuadrilateralVertex, vertexLabel: TReadOnlyProperty<string>, quadrilateralModel: QuadrilateralModel, vertexDescriber: VertexDescriber, modelViewTransform: ModelViewTransform2, providedOptions?: VertexNodeOptions ) {

const options = optionize<VertexNodeOptions, SelfOptions, QuadrilateralMovableNodeOptions>()( {
grabbedSound: grabHighPitch_mp3,
visibleProperty: quadrilateralModel.visibilityModel.vertexLabelsVisibleProperty
grabbedSound: grabHighPitch_mp3
}, providedOptions );

const viewRadius = modelViewTransform.modelToViewBounds( vertex.modelBoundsProperty.value ).width / 2;
Expand All @@ -55,6 +54,7 @@ export default class QuadrilateralVertexNode extends QuadrilateralMovableNode {

const vertexLabelText = new Text( vertexLabel, {
font: LABEL_TEXT_FONT,
visibleProperty: quadrilateralModel.visibilityModel.vertexLabelsVisibleProperty,

// i18n
maxWidth: 12 // by inspection
Expand Down

0 comments on commit f4594e6

Please sign in to comment.