Skip to content

Commit

Permalink
fix(chord chart): remove y-offset of triangle shaped fingers
Browse files Browse the repository at this point in the history
  • Loading branch information
Voellmy Raphael authored and Voellmy Raphael committed Jul 19, 2020
1 parent ac0b118 commit 492358d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/renderer/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ export interface GraphcisElement {
}

export abstract class Renderer {
/**
* Constant modifier to get the centroid of a equilateral triangle.
*/
protected static readonly TRIANGLE_Y_OFFSET = 0.1547006

constructor(protected container: QuerySelector | HTMLElement) {}
protected constructor(protected container: QuerySelector | HTMLElement) {}

abstract line(
x1: number,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/svgjs/svg-js-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class SvgJsRenderer extends Renderer {
): GraphcisElement {
const element = this.svg
.path(Renderer.trianglePath(x, y, size))
.move(x, y - size * Renderer.TRIANGLE_Y_OFFSET)
.move(x, y)
.fill(fill || 'none')
.stroke({
width: strokeWidth,
Expand Down

0 comments on commit 492358d

Please sign in to comment.