전략편집기 수정1
This commit is contained in:
@@ -77,16 +77,33 @@ export function projectScreenToFlowPosition(
|
||||
);
|
||||
}
|
||||
|
||||
/** 목록 방식 편집기 위인지 */
|
||||
/** 목록 방식 편집기 위인지 (rect hit-test) */
|
||||
export function isOverListEditor(clientX: number, clientY: number): boolean {
|
||||
for (const el of elementsUnderDragPoint(clientX, clientY)) {
|
||||
if (el.closest('.se-list-editor')) return true;
|
||||
const editors = document.querySelectorAll<HTMLElement>('.se-list-editor');
|
||||
for (const el of editors) {
|
||||
const rect = el.getBoundingClientRect();
|
||||
if (
|
||||
clientX >= rect.left && clientX <= rect.right
|
||||
&& clientY >= rect.top && clientY <= rect.bottom
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 팔레트 드롭 — 전략 빌더 캔버스 위인지 */
|
||||
export function isOverStrategyBuilder(clientX: number, clientY: number): boolean {
|
||||
const canvas = document.querySelector<HTMLElement>('.se-canvas-wrap');
|
||||
if (canvas) {
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
if (
|
||||
clientX >= rect.left && clientX <= rect.right
|
||||
&& clientY >= rect.top && clientY <= rect.bottom
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const el of elementsUnderDragPoint(clientX, clientY)) {
|
||||
if (el.closest('.se-palette-panel, .se-side-wrap--right')) continue;
|
||||
if (el.closest('.se-canvas-wrap, .react-flow__pane, .react-flow__renderer')) return true;
|
||||
@@ -171,7 +188,7 @@ export function resolvePaletteDropClientPoint(
|
||||
return { flowPos, anchorId: domId };
|
||||
}
|
||||
|
||||
if (getActivePaletteDrag()) {
|
||||
if (getActivePaletteDrag() || isPaletteHtmlDragActive()) {
|
||||
const flowHit = findAtFlow(flowPos, nodes);
|
||||
if (flowHit && isConnectTarget(flowHit.id)) {
|
||||
return { flowPos, anchorId: flowHit.id };
|
||||
|
||||
Reference in New Issue
Block a user