From 8da8408a0aad61625e5bc9be2c42c84fb7d64b8b Mon Sep 17 00:00:00 2001 From: jaredvu Date: Mon, 27 Nov 2023 10:18:35 -0800 Subject: [PATCH] hard code height/width to avoid scaling issues --- src/views/Orderbook.tsx | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/views/Orderbook.tsx b/src/views/Orderbook.tsx index 3f1008b..609d03f 100644 --- a/src/views/Orderbook.tsx +++ b/src/views/Orderbook.tsx @@ -163,16 +163,8 @@ export const Orderbook = ({ side="ask" onMouseLeave={() => setHoveredRow(undefined)} > - <$HistogramCanvas - ref={asksCanvasRef} - width={asksCanvasRef.current?.clientWidth ?? 0} - height={asksCanvasRef.current?.clientHeight ?? 0} - /> - <$HistogramCanvas - ref={asksHoverRef} - width={asksCanvasRef.current?.clientWidth ?? 0} - height={asksCanvasRef.current?.clientHeight ?? 0} - /> + <$HistogramCanvas ref={asksCanvasRef} width={300} height={numRows * ROW_HEIGHT} /> + <$HistogramCanvas ref={asksHoverRef} width={300} height={numRows * ROW_HEIGHT} /> {asksSlice.map((row: RowData, idx) => row.price ? ( @@ -200,16 +192,8 @@ export const Orderbook = ({ side="bid" onMouseLeave={() => setHoveredRow(undefined)} > - <$HistogramCanvas - ref={bidsCanvasRef} - width={bidsCanvasRef.current?.clientWidth ?? 0} - height={bidsCanvasRef.current?.clientHeight ?? 0} - /> - <$HistogramCanvas - ref={bidsHoverRef} - width={bidsCanvasRef.current?.clientWidth ?? 0} - height={bidsCanvasRef.current?.clientHeight ?? 0} - /> + <$HistogramCanvas ref={bidsCanvasRef} width={300} height={numRows * ROW_HEIGHT} /> + <$HistogramCanvas ref={bidsHoverRef} width={300} height={numRows * ROW_HEIGHT} /> {bidsSlice.map((row: RowData, idx) => row.price ? (