Skip to content

Commit

Permalink
https://github.com/phetsims/graphing-lines/issues/139
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Apr 25, 2023
1 parent e312cee commit 8190b34
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
8 changes: 3 additions & 5 deletions js/common/view/LineNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const SCENERY_LINE_OPTIONS = {
lineWidth: TAIL_WIDTH
};

type LineProperty = Property<Line> | Property<Line | NotALine>;

// Options for SelfOptions.createDynamicLabel
export type CreateDynamicLabelOptions = {
pickable?: boolean;
Expand All @@ -54,7 +52,7 @@ export type CreateDynamicLabelOptions = {
slopeUndefinedVisible?: boolean;
};

export type CreateDynamicLabelFunction = ( lineProperty: LineProperty, providedOptions?: CreateDynamicLabelOptions ) => Node;
export type CreateDynamicLabelFunction = ( lineProperty: Property<Line>, providedOptions?: CreateDynamicLabelOptions ) => Node;

type SelfOptions = {

Expand All @@ -69,7 +67,7 @@ type LineNodeOptions = SelfOptions;

export default class LineNode extends Node {

public readonly lineProperty: LineProperty;
public readonly lineProperty: Property<Line>;
private readonly graph: Graph;
private readonly modelViewTransform: ModelViewTransform2;
private readonly xExtent: number;
Expand All @@ -86,7 +84,7 @@ export default class LineNode extends Node {

private readonly disposeLineNode: () => void;

public constructor( lineProperty: LineProperty,
public constructor( lineProperty: Property<Line>,
graph: Graph,
modelViewTransform: ModelViewTransform2,
providedOptions?: LineNodeOptions ) {
Expand Down
1 change: 1 addition & 0 deletions js/linegame/view/ChallengeGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default class ChallengeGraphNode extends GraphNode {
this.answerPointNode.translation = challenge.modelViewTransform.modelToViewXY( challenge.answer.x1, challenge.answer.y1 );

// guess
// @ts-expect-error Property<Line | NotALine>
this.guessLineNode = new LineNode( challenge.guessProperty, challenge.graph, challenge.modelViewTransform );
this.guessPointNode = new PlottedPointNode( pointRadius, LineGameConstants.GUESS_COLOR );

Expand Down
1 change: 0 additions & 1 deletion js/pointslope/view/PointSlopeGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default class PointSlopeGraphNode extends LineFormsGraphNode {

public constructor( model: PointSlopeModel, viewProperties: LineFormsViewProperties ) {

// @ts-expect-error Property<Line | NotALine>
super( model, viewProperties, PointSlopeEquationNode.createDynamicLabel );

const manipulatorRadius = model.modelViewTransform.modelToViewDeltaX( model.manipulatorRadius );
Expand Down
1 change: 0 additions & 1 deletion js/slope/view/SlopeGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default class SlopeGraphNode extends LineFormsGraphNode {

public constructor( model: SlopeModel, viewProperties: LineFormsViewProperties ) {

// @ts-expect-error Property<Line | NotALine>
super( model, viewProperties, SlopeEquationNode.createDynamicLabel );

const manipulatorRadius = model.modelViewTransform.modelToViewDeltaX( model.manipulatorRadius );
Expand Down
1 change: 0 additions & 1 deletion js/slopeintercept/view/SlopeInterceptGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default class SlopeInterceptGraphNode extends LineFormsGraphNode {

public constructor( model: SlopeInterceptModel, viewProperties: LineFormsViewProperties ) {

// @ts-expect-error Property<Line | NotALine>
super( model, viewProperties, SlopeInterceptEquationNode.createDynamicLabel );

const manipulatorRadius = model.modelViewTransform.modelToViewDeltaX( model.manipulatorRadius );
Expand Down

0 comments on commit 8190b34

Please sign in to comment.