Clicking selection reopens menu
This commit is contained in:
parent
ac4ca5b364
commit
4ac4c3aa33
@ -163,6 +163,7 @@ function Selection({
|
||||
// Increase stroke width when drawing a selection to
|
||||
// prevent deselection click event from firing
|
||||
hitStrokeWidth: hasItems ? undefined : 100,
|
||||
id: "selection",
|
||||
};
|
||||
const x = selection.x * mapWidth;
|
||||
const y = selection.y * mapHeight;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { Group } from "react-konva";
|
||||
import Konva from "konva";
|
||||
|
||||
import {
|
||||
useDebouncedStageScale,
|
||||
@ -28,7 +29,6 @@ import {
|
||||
} from "../../types/Select";
|
||||
import { RectData } from "../../types/Drawing";
|
||||
import { useGridCellNormalizedSize } from "../../contexts/GridContext";
|
||||
import Konva from "konva";
|
||||
import Selection from "../konva/Selection";
|
||||
import { SelectionItemsChangeEventHandler } from "../../types/Events";
|
||||
import { getSelectionPoints } from "../../helpers/selection";
|
||||
@ -223,12 +223,13 @@ function SelectTool({
|
||||
setIsBrushDown(false);
|
||||
}
|
||||
|
||||
function handlePointerClick() {
|
||||
if (preventSelectionRef.current) {
|
||||
return;
|
||||
function handlePointerClick(event: Konva.KonvaEventObject<MouseEvent>) {
|
||||
if (event.target.id() === "selection") {
|
||||
onSelectionMenuOpen(true);
|
||||
} else {
|
||||
onSelectionChange(null);
|
||||
onSelectionMenuOpen(false);
|
||||
}
|
||||
onSelectionChange(null);
|
||||
onSelectionMenuOpen(false);
|
||||
}
|
||||
|
||||
interactionEmitter?.on("dragStart", handleBrushDown);
|
||||
|
Loading…
Reference in New Issue
Block a user