update simplifier distance to reflect zoom (#2004)
* update simplifier distance to reflect zoom The distance used in the iterative end-point fit algorithm to determine if points can be removed no longer ignores the zoom. As the zoom gets larger this distance will get smaller and fewer points will be removed, thus making for finer grain control over the drawing. As the zoom gets smaller the drawing will get more coarse as more points are removed. * remove the comment Co-authored-by: John Dupuis <wasp7@Johns-MacBook-Pro.local> Co-authored-by: Michal Srb <xixixao@seznam.cz>
This commit is contained in:
parent
403e8bd307
commit
5f195694ee
@ -2892,7 +2892,10 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||||||
} else if (points.length > 1) {
|
} else if (points.length > 1) {
|
||||||
if (draggingElement.type === "draw") {
|
if (draggingElement.type === "draw") {
|
||||||
mutateElement(draggingElement, {
|
mutateElement(draggingElement, {
|
||||||
points: simplify([...(points as Point[]), [dx, dy]], 0.7),
|
points: simplify(
|
||||||
|
[...(points as Point[]), [dx, dy]],
|
||||||
|
0.7 / this.state.zoom,
|
||||||
|
),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
mutateElement(draggingElement, {
|
mutateElement(draggingElement, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user