Skip to content

Commit

Permalink
perf: only use sharp points for price chart axis connection, dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
dib542 committed May 23, 2024
1 parent dc3ddcf commit 00d41ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pages/Orderbook/OrderbookChartConnector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ export default function OrderbookChartConnector({
ctx.strokeStyle = 'white';
ctx.beginPath();
connectionLines.forEach(([y1, y2]) => {
ctx.moveTo(sharpPoint(connectionCurve[0]), sharpPoint(y1));
ctx.lineTo(sharpPoint(connectionCurve[1]), sharpPoint(y1));
ctx.moveTo(connectionCurve[0], sharpPoint(y1));
ctx.lineTo(connectionCurve[1], sharpPoint(y1));
ctx.bezierCurveTo(
...[sharpPoint(connectionCurve[2]), sharpPoint(y1)],
...[sharpPoint(connectionCurve[3]), sharpPoint(y2)],
...[sharpPoint(connectionCurve[4]), sharpPoint(y2)]
...[connectionCurve[2], sharpPoint(y1)],
...[connectionCurve[3], y2],
...[connectionCurve[4], y2]
);
ctx.lineTo(sharpPoint(connectionCurve[5]), sharpPoint(y2));
ctx.lineTo(connectionCurve[5], y2);
});
ctx.stroke();
}
Expand Down

0 comments on commit 00d41ba

Please sign in to comment.