From e80ab1c8a20b82d9630d7d2ba4de6a8d78103e0e Mon Sep 17 00:00:00 2001 From: lissitz <53315888+lissitz@users.noreply.github.com> Date: Sat, 22 Feb 2020 10:21:54 +0100 Subject: [PATCH] Don't render bounding box for multi-point lines during creation (#799) * don't render bounding box for multi-point lines during creation * force LayerUI rerender after creating a new point Force LayerUI rerender after creating a new point so that the mobile UI updates and the Done button is visible. * don't select multiElement on confirm is locked Co-authored-by: David Luzar --- src/actions/actionFinalize.tsx | 3 +++ src/index.tsx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actions/actionFinalize.tsx b/src/actions/actionFinalize.tsx index 814c3898..2baa2508 100644 --- a/src/actions/actionFinalize.tsx +++ b/src/actions/actionFinalize.tsx @@ -27,6 +27,9 @@ export const actionFinalize: Action = { newElements = newElements.slice(0, -1); } appState.multiElement.shape = null; + if (!appState.elementLocked) { + appState.multiElement.isSelected = true; + } } if (!appState.elementLocked || !appState.multiElement) { resetCursor(); diff --git a/src/index.tsx b/src/index.tsx index 484e11e7..fc393d84 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1366,7 +1366,8 @@ export class App extends React.Component { if (this.state.multiElement) { const { multiElement } = this.state; const { x: rx, y: ry } = multiElement; - multiElement.isSelected = true; + //force LayerUI rerender + elements = elements.slice(); multiElement.points.push([x - rx, y - ry]); multiElement.shape = null; } else {