|
@@ -259,6 +259,7 @@ import {
|
|
getApproxMinLineWidth,
|
|
getApproxMinLineWidth,
|
|
getBoundTextElement,
|
|
getBoundTextElement,
|
|
getContainerDims,
|
|
getContainerDims,
|
|
|
|
+ isValidTextContainer,
|
|
} from "../element/textElement";
|
|
} from "../element/textElement";
|
|
import { isHittingElementNotConsideringBoundingBox } from "../element/collision";
|
|
import { isHittingElementNotConsideringBoundingBox } from "../element/collision";
|
|
import {
|
|
import {
|
|
@@ -1974,7 +1975,9 @@ class App extends React.Component<AppProps, AppState> {
|
|
);
|
|
);
|
|
|
|
|
|
if (selectedElements.length === 1) {
|
|
if (selectedElements.length === 1) {
|
|
- if (isLinearElement(selectedElements[0])) {
|
|
|
|
|
|
+ const selectedElement = selectedElements[0];
|
|
|
|
+
|
|
|
|
+ if (isLinearElement(selectedElement)) {
|
|
if (
|
|
if (
|
|
!this.state.editingLinearElement ||
|
|
!this.state.editingLinearElement ||
|
|
this.state.editingLinearElement.elementId !==
|
|
this.state.editingLinearElement.elementId !==
|
|
@@ -1983,14 +1986,15 @@ class App extends React.Component<AppProps, AppState> {
|
|
this.history.resumeRecording();
|
|
this.history.resumeRecording();
|
|
this.setState({
|
|
this.setState({
|
|
editingLinearElement: new LinearElementEditor(
|
|
editingLinearElement: new LinearElementEditor(
|
|
- selectedElements[0],
|
|
|
|
|
|
+ selectedElement,
|
|
this.scene,
|
|
this.scene,
|
|
),
|
|
),
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- const selectedElement = selectedElements[0];
|
|
|
|
-
|
|
|
|
|
|
+ } else if (
|
|
|
|
+ isTextElement(selectedElement) ||
|
|
|
|
+ isValidTextContainer(selectedElement)
|
|
|
|
+ ) {
|
|
this.startTextEditing({
|
|
this.startTextEditing({
|
|
sceneX: selectedElement.x + selectedElement.width / 2,
|
|
sceneX: selectedElement.x + selectedElement.width / 2,
|
|
sceneY: selectedElement.y + selectedElement.height / 2,
|
|
sceneY: selectedElement.y + selectedElement.height / 2,
|
|
@@ -2610,8 +2614,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
);
|
|
);
|
|
if (selectedElements.length === 1) {
|
|
if (selectedElements.length === 1) {
|
|
const selectedElement = selectedElements[0];
|
|
const selectedElement = selectedElements[0];
|
|
- const canBindText = hasBoundTextElement(selectedElement);
|
|
|
|
- if (canBindText) {
|
|
|
|
|
|
+ if (hasBoundTextElement(selectedElement)) {
|
|
sceneX = selectedElement.x + selectedElement.width / 2;
|
|
sceneX = selectedElement.x + selectedElement.width / 2;
|
|
sceneY = selectedElement.y + selectedElement.height / 2;
|
|
sceneY = selectedElement.y + selectedElement.height / 2;
|
|
}
|
|
}
|
|
@@ -3913,8 +3916,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
includeBoundTextElement: true,
|
|
includeBoundTextElement: true,
|
|
});
|
|
});
|
|
|
|
|
|
- const canBindText = hasBoundTextElement(element);
|
|
|
|
- if (canBindText) {
|
|
|
|
|
|
+ if (hasBoundTextElement(element)) {
|
|
sceneX = element.x + element.width / 2;
|
|
sceneX = element.x + element.width / 2;
|
|
sceneY = element.y + element.height / 2;
|
|
sceneY = element.y + element.height / 2;
|
|
}
|
|
}
|