Compare commits

...

2 Commits

Author SHA1 Message Date
Alejandro Alonso
616504dc84 WIP 2026-02-05 09:49:17 +01:00
Alejandro Alonso
8300e70ab0 🐛 Fix grid lines 2026-02-05 09:46:01 +01:00
2 changed files with 27 additions and 9 deletions

View File

@@ -568,7 +568,9 @@
(extract-property-changes modif-tree)]
(-> state
(assoc :prev-wasm-props (:wasm-props state))
(assoc :wasm-props property-changes))))
(assoc :wasm-props property-changes)
;; Keep overlays in sync during WASM transforms.
(assoc :workspace-modifiers modif-tree))))
ptk/WatchEvent
(watch [_ state _]

View File

@@ -16,6 +16,7 @@
[app.common.types.path :as path]
[app.common.types.shape :as cts]
[app.common.types.shape.layout :as ctl]
[app.common.types.shape-tree :as ctt]
[app.main.data.common :as dcm]
[app.main.data.workspace.transforms :as dwt]
[app.main.data.workspace.variants :as dwv]
@@ -98,6 +99,7 @@
drawing (mf/deref refs/workspace-drawing)
focus (mf/deref refs/workspace-focus-selected)
wasm-modifiers (mf/deref refs/workspace-wasm-modifiers)
modifiers (mf/deref refs/workspace-modifiers)
workspace-editor-state (mf/deref refs/workspace-editor-state)
@@ -364,11 +366,11 @@
(when (and @canvas-init? initialized?)
(wasm.api/set-canvas-background background)))
(mf/with-effect [@canvas-init? hover-grid? @hover-top-frame-id]
(when @canvas-init?
(if hover-grid?
(wasm.api/show-grid @hover-top-frame-id)
(wasm.api/clear-grid))))
;; (mf/with-effect [@canvas-init? hover-grid? @hover-top-frame-id]
;; (when @canvas-init?
;; (if hover-grid?
;; (wasm.api/show-grid @hover-top-frame-id)
;; (wasm.api/clear-grid))))
(hooks/setup-dom-events zoom disable-paste-ref in-viewport-ref read-only? drawing-tool path-drawing?)
(hooks/setup-viewport-size vport viewport-ref)
@@ -701,13 +703,27 @@
:on-click add-variant}])
[:g.grid-layout-editor {:clipPath "url(#clip-handlers)"}
(when show-grid-editor?
(when (or show-grid-editor? hover-grid?)
[:& grid-layout/editor
{:zoom zoom
:objects objects-modified
:objects base-objects
:modifiers modifiers
:shape (or (get base-objects edition)
(get base-objects @hover-top-frame-id))
:view-only (not show-grid-editor?)}])]
:view-only (not show-grid-editor?)}])
(for [frame (ctt/get-frames objects)]
(when (and (ctl/grid-layout? frame)
(empty? (:shapes frame))
(not= edition (:id frame))
(not= @hover-top-frame-id (:id frame)))
[:& grid-layout/editor
{:zoom zoom
:key (dm/str (:id frame))
:objects base-objects
:modifiers modifiers
:shape frame
:view-only true}]))]
[:g.scrollbar-wrapper {:clipPath "url(#clip-handlers)"}
[:& scroll-bars/viewport-scrollbars