From d9cbda45e6aa6f803c2a1c6dbd41e9e7820ed1d2 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Fri, 4 Jun 2021 17:14:01 +0100 Subject: [PATCH] Fixes groups --- lib/code/index.ts | 2 +- state/sessions/arrow-session.ts | 6 +++--- state/sessions/draw-session.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/code/index.ts b/lib/code/index.ts index b08bfad72..2e54e6303 100644 --- a/lib/code/index.ts +++ b/lib/code/index.ts @@ -19,7 +19,7 @@ export default class CodeShape { private utils: ShapeUtility constructor(props: T) { - this._shape = createShape(props.type, props) + this._shape = createShape(props.type, props) as T this.utils = getShapeUtils(this._shape) codeShapes.add(this) } diff --git a/state/sessions/arrow-session.ts b/state/sessions/arrow-session.ts index b8c5f4d67..2c459ef38 100644 --- a/state/sessions/arrow-session.ts +++ b/state/sessions/arrow-session.ts @@ -6,7 +6,7 @@ import { current } from 'immer' import { getBoundsFromPoints, getPage, updateParents } from 'utils/utils' import { getShapeUtils } from 'lib/shape-utils' -export default class PointsSession extends BaseSession { +export default class ArrowSession extends BaseSession { points: number[][] origin: number[] snapshot: ArrowSnapshot @@ -58,7 +58,7 @@ export default class PointsSession extends BaseSession { }, }) - updateParents(data, [shape]) + updateParents(data, [shape.id]) } cancel(data: Data) { @@ -70,7 +70,7 @@ export default class PointsSession extends BaseSession { .onHandleChange(shape, { end: initialShape.handles.end }) .setProperty(shape, 'point', initialShape.point) - updateParents(data, [shape]) + updateParents(data, [shape.id]) } complete(data: Data) { diff --git a/state/sessions/draw-session.ts b/state/sessions/draw-session.ts index 37f268b38..3ca50ef5d 100644 --- a/state/sessions/draw-session.ts +++ b/state/sessions/draw-session.ts @@ -75,14 +75,14 @@ export default class BrushSession extends BaseSession { const shape = getShape(data, snapshot.id) as DrawShape getShapeUtils(shape).setProperty(shape, 'points', [...this.points]) - updateParents(data, [shape]) + updateParents(data, [shape.id]) } cancel = (data: Data) => { const { snapshot } = this const shape = getShape(data, snapshot.id) as DrawShape getShapeUtils(shape).setProperty(shape, 'points', snapshot.points) - updateParents(data, [shape]) + updateParents(data, [shape.id]) } complete = (data: Data) => {