mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: adjust line-confirm-threshold based on zoom (#2884)
Co-authored-by: Lipis <lipiridis@gmail.com>
This commit is contained in:
parent
ba9b65b051
commit
e6cd97c4f2
5 changed files with 18 additions and 12 deletions
|
@ -1963,7 +1963,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
points: points.slice(0, -1),
|
||||
});
|
||||
} else {
|
||||
if (isPathALoop(points)) {
|
||||
if (isPathALoop(points, this.state.zoom.value)) {
|
||||
document.documentElement.style.cursor = CURSOR_TYPE.POINTER;
|
||||
}
|
||||
// update last uncommitted point
|
||||
|
@ -2635,7 +2635,10 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
const { multiElement } = this.state;
|
||||
|
||||
// finalize if completing a loop
|
||||
if (multiElement.type === "line" && isPathALoop(multiElement.points)) {
|
||||
if (
|
||||
multiElement.type === "line" &&
|
||||
isPathALoop(multiElement.points, this.state.zoom.value)
|
||||
) {
|
||||
mutateElement(multiElement, {
|
||||
lastCommittedPoint:
|
||||
multiElement.points[multiElement.points.length - 1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue