mirror of
https://github.com/penpot/penpot.git
synced 2025-03-18 10:41:29 -05:00
Make grid fill all the workspace instead only canvas.
This commit is contained in:
parent
50e8de4552
commit
69329f7f64
2 changed files with 10 additions and 7 deletions
|
@ -69,9 +69,7 @@
|
|||
(for [item (reverse (:shapes page))]
|
||||
(-> (uus/shape item)
|
||||
(rum/with-key (str item))))
|
||||
(draw-area)]]
|
||||
(when (contains? flags :grid)
|
||||
(grid))])))
|
||||
(draw-area)]]])))
|
||||
|
||||
(def canvas
|
||||
(mx/component
|
||||
|
@ -87,6 +85,7 @@
|
|||
[own]
|
||||
(let [workspace (rum/react uuwb/workspace-l)
|
||||
page (rum/react uuwb/page-l)
|
||||
flags (:flags workspace)
|
||||
drawing? (:drawing workspace)
|
||||
zoom (or (:zoom workspace) 1)]
|
||||
(letfn [(on-mouse-down [event]
|
||||
|
@ -109,9 +108,11 @@
|
|||
:on-mouse-up on-mouse-up}
|
||||
[:g.zoom {:transform (str "scale(" zoom ", " zoom ")")}
|
||||
(if page
|
||||
(canvas page))]
|
||||
(ruler)
|
||||
(selrect)]))))
|
||||
(canvas page))
|
||||
(if (contains? flags :grid)
|
||||
(grid))]
|
||||
(ruler)
|
||||
(selrect)]))))
|
||||
|
||||
(defn- viewport-did-mount
|
||||
[own]
|
||||
|
|
|
@ -20,8 +20,10 @@
|
|||
|
||||
(defn- grid-render
|
||||
[own]
|
||||
(let [{:keys [width height options]} (deref wb/page-l)
|
||||
(let [options (:options @wb/page-l)
|
||||
color (:grid/color options "#cccccc")
|
||||
width wb/viewport-width
|
||||
height wb/viewport-height
|
||||
x-ticks (ticks-range width (:grid/x-axis options 10))
|
||||
y-ticks (ticks-range height (:grid/y-axis options 10))
|
||||
path (as-> [] $
|
||||
|
|
Loading…
Add table
Reference in a new issue