feat: hide point highlight when dragging

This commit is contained in:
dwelle
2025-11-12 22:31:22 +01:00
parent db8895ac16
commit 9c0e715cb8
3 changed files with 13 additions and 10 deletions

View File

@@ -630,7 +630,7 @@ export class LinearElementEditor {
? endBindingElement ? endBindingElement
: null; : null;
const newLinearElementEditor = { const newLinearElementEditor: LinearElementEditor = {
...linearElementEditor, ...linearElementEditor,
selectedPointsIndices: newSelectedPointsIndices, selectedPointsIndices: newSelectedPointsIndices,
initialState: { initialState: {

View File

@@ -8911,6 +8911,7 @@ class App extends React.Component<AppProps, AppState> {
this.setState({ this.setState({
selectedLinearElement: { selectedLinearElement: {
...this.state.selectedLinearElement, ...this.state.selectedLinearElement,
isDragging: true,
segmentMidPointHoveredCoords: ret.segmentMidPointHoveredCoords, segmentMidPointHoveredCoords: ret.segmentMidPointHoveredCoords,
initialState: ret.initialState, initialState: ret.initialState,
}, },

View File

@@ -1278,15 +1278,17 @@ const _renderInteractiveScene = ({
(el) => el.id === editor.elementId, // Don't forget bound text elements! (el) => el.id === editor.elementId, // Don't forget bound text elements!
); );
if (editor.segmentMidPointHoveredCoords) { if (!appState.selectedLinearElement.isDragging) {
renderElbowArrowMidPointHighlight(context, appState); if (editor.segmentMidPointHoveredCoords) {
} else if ( renderElbowArrowMidPointHighlight(context, appState);
isElbowArrow(firstSelectedLinear) } else if (
? editor.hoverPointIndex === 0 || isElbowArrow(firstSelectedLinear)
editor.hoverPointIndex === firstSelectedLinear.points.length - 1 ? editor.hoverPointIndex === 0 ||
: editor.hoverPointIndex >= 0 editor.hoverPointIndex === firstSelectedLinear.points.length - 1
) { : editor.hoverPointIndex >= 0
renderLinearElementPointHighlight(context, appState, elementsMap); ) {
renderLinearElementPointHighlight(context, appState, elementsMap);
}
} }
} }