Skip to content

Commit

Permalink
fix(render): Unexpected displaying position of line number in graphin…
Browse files Browse the repository at this point in the history
…g mode
  • Loading branch information
NriotHrreion committed Jan 5, 2024
1 parent 0e7d841 commit 505cf9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderer/Graphics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export default class Graphics {
this.drawStraightLine(y2, Graphics.colors.secondary);

// number of the line
this.drawText((i * this.spacing).toString(), this.center.x - (this.getTextWidth((i * this.spacing).toString()) + 5) * this.ratio, y1 + 5 * this.ratio, Graphics.colors.primary, 15);
this.drawText((-i * this.spacing).toString(), this.center.x - (this.getTextWidth((-i * this.spacing).toString()) + 5) * this.ratio, y2 + 5 * this.ratio, Graphics.colors.primary, 15);
this.drawText((i * this.spacing).toString(), this.center.x - (this.getTextWidth((i * this.spacing).toString()) / this.ratio + 5) * this.ratio, y1 + 5 * this.ratio, Graphics.colors.primary, 15);
this.drawText((-i * this.spacing).toString(), this.center.x - (this.getTextWidth((-i * this.spacing).toString()) / this.ratio + 5) * this.ratio, y2 + 5 * this.ratio, Graphics.colors.primary, 15);
}
// thinner line
for(
Expand Down Expand Up @@ -117,8 +117,8 @@ export default class Graphics {
this.drawVerticalLine(x2, Graphics.colors.secondary);

// number of the line
this.drawText((-k * this.spacing).toString(), x1 - (this.getTextWidth((-k * this.spacing).toString()) / 2) * this.ratio, this.center.y + 15 * this.ratio, Graphics.colors.primary, 15);
this.drawText((k * this.spacing).toString(), x2 - (this.getTextWidth((k * this.spacing).toString()) / 2) * this.ratio, this.center.y + 15 * this.ratio, Graphics.colors.primary, 15);
this.drawText((-k * this.spacing).toString(), x1 - (this.getTextWidth((-k * this.spacing).toString()) / this.ratio / 2) * this.ratio, this.center.y + 15 * this.ratio, Graphics.colors.primary, 15);
this.drawText((k * this.spacing).toString(), x2 - (this.getTextWidth((k * this.spacing).toString()) / this.ratio / 2) * this.ratio, this.center.y + 15 * this.ratio, Graphics.colors.primary, 15);
}
// thinner line
for(
Expand Down

1 comment on commit 505cf9c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.