0
Fork 0
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:
Andrey Antukh 2016-04-09 23:19:11 +03:00
parent 50e8de4552
commit 69329f7f64
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
2 changed files with 10 additions and 7 deletions

View file

@ -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]

View file

@ -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-> [] $