fix(canvas): 画布弹层 - 缩放平移时保持下拉框锚点同步
This commit is contained in:
@@ -12,7 +12,11 @@ export function applyCanvasLiveViewport(container: HTMLDivElement | null, viewpo
|
||||
container.style.setProperty("--canvas-grid-x", `${viewport.x % gridSize}px`);
|
||||
container.style.setProperty("--canvas-grid-y", `${viewport.y % gridSize}px`);
|
||||
container.style.setProperty("--canvas-dot-size", viewport.k < 0.12 ? "0.8px" : "1.15px");
|
||||
if (notify) container.dispatchEvent(new CustomEvent<ViewportTransform>(CANVAS_VIEWPORT_PREVIEW_EVENT, { detail: viewport }));
|
||||
if (notify) {
|
||||
container.dispatchEvent(new CustomEvent<ViewportTransform>(CANVAS_VIEWPORT_PREVIEW_EVENT, { detail: viewport }));
|
||||
// Ant Design overlays watch scrollable ancestors, but CSS transforms do not emit layout events.
|
||||
container.dispatchEvent(new Event("scroll"));
|
||||
}
|
||||
}
|
||||
|
||||
export function subscribeCanvasViewportPreview(container: HTMLDivElement, listener: (viewport: ViewportTransform) => void) {
|
||||
|
||||
Reference in New Issue
Block a user