From ae92541b149b6219ac0e8f09702cbb96917f0080 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Wed, 8 Nov 2023 12:08:13 -0500 Subject: [PATCH] fix: twice shift [X|Y] --- src/component/2d/ft/Contours.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/component/2d/ft/Contours.tsx b/src/component/2d/ft/Contours.tsx index 78217dff4..6eeaa436c 100644 --- a/src/component/2d/ft/Contours.tsx +++ b/src/component/2d/ft/Contours.tsx @@ -36,7 +36,6 @@ function usePath( ) { const scaleX = useScale2DX(); const scaleY = useScale2DY(); - const shift = getShift(spectrum); const pathBuilder = new PathBuilder(); for (const element of contours) { @@ -44,14 +43,8 @@ function usePath( const lines = element.lines; if (lines.length < 1e6) { for (let i = 0; i < lines.length; i += 4) { - pathBuilder.moveTo( - scaleX(lines[i] + shift.x), - scaleY(lines[i + 1] + shift.y), - ); - pathBuilder.lineTo( - scaleX(lines[i + 2] + shift.x), - scaleY(lines[i + 3] + shift.y), - ); + pathBuilder.moveTo(scaleX(lines[i]), scaleY(lines[i + 1])); + pathBuilder.lineTo(scaleX(lines[i + 2]), scaleY(lines[i + 3])); } } }