ソースを参照

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 <luzar.david@gmail.com>
lissitz 5 年 前
コミット
e80ab1c8a2
2 ファイル変更5 行追加1 行削除
  1. 3 0
      src/actions/actionFinalize.tsx
  2. 2 1
      src/index.tsx

+ 3 - 0
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();

+ 2 - 1
src/index.tsx

@@ -1366,7 +1366,8 @@ export class App extends React.Component<any, AppState> {
                 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 {