fix: remove rounding to fix jitter when shift-editing (#5543)

Co-authored-by: Ryan Di <ryan.weihao.di@gmail.com>
This commit is contained in:
David Luzar 2022-08-05 16:52:46 +02:00 committed by GitHub
parent b818df1098
commit 45b592227d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 26 deletions

View file

@ -178,17 +178,13 @@ export class LinearElementEditor {
const referencePoint =
element.points[selectedIndex === 0 ? 1 : selectedIndex - 1];
let [width, height] = LinearElementEditor._getShiftLockedDelta(
const [width, height] = LinearElementEditor._getShiftLockedDelta(
element,
referencePoint,
[scenePointerX, scenePointerY],
appState.gridSize,
);
// rounding to stop the dragged point from jiggling
width = Math.round(width);
height = Math.round(height);
LinearElementEditor.movePoints(element, [
{
index: selectedIndex,