mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
hide n-1 point if distance is less than threshold
This commit is contained in:
parent
cd195374bc
commit
330b3a0530
1 changed files with 6 additions and 5 deletions
|
@ -437,11 +437,12 @@ export class LinearElementEditor {
|
||||||
appState.zoom.value;
|
appState.zoom.value;
|
||||||
}
|
}
|
||||||
const isExtremePoint = index === 0 || index === element.points.length - 1;
|
const isExtremePoint = index === 0 || index === element.points.length - 1;
|
||||||
if (
|
const threshold = 2 * LinearElementEditor.POINT_HANDLE_SIZE;
|
||||||
editingLinearElement ||
|
if (editingLinearElement || isExtremePoint || distance >= threshold) {
|
||||||
isExtremePoint ||
|
// hide n-1 point if distance is less than threshold
|
||||||
distance >= 2 * LinearElementEditor.POINT_HANDLE_SIZE
|
if (isExtremePoint && distance < threshold) {
|
||||||
) {
|
visiblePointIndexes.pop();
|
||||||
|
}
|
||||||
visiblePointIndexes.push(index);
|
visiblePointIndexes.push(index);
|
||||||
previousPoint = point;
|
previousPoint = point;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue