regenerate seed on change of sloppiness (#1986)

This commit is contained in:
David Luzar 2020-07-30 20:14:38 +02:00 committed by GitHub
parent 818821c293
commit fea257765d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 11 deletions

View file

@ -21,6 +21,7 @@ import { t } from "../i18n";
import { register } from "./register";
import { newElementWith } from "../element/mutateElement";
import { DEFAULT_FONT_SIZE, DEFAULT_FONT_FAMILY } from "../constants";
import { randomInteger } from "../random";
const changeProperty = (
elements: readonly ExcalidrawElement[],
@ -199,6 +200,7 @@ export const actionChangeSloppiness = register({
return {
elements: changeProperty(elements, appState, (el) =>
newElementWith(el, {
seed: randomInteger(),
roughness: value,
}),
),