mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 17:18:21 -05:00
🐛 Fix rules rendering
This commit is contained in:
parent
81fff2b5e8
commit
0214cfa299
2 changed files with 4 additions and 1 deletions
|
@ -35,7 +35,7 @@
|
||||||
objects (wsh/lookup-page-objects state page-id)
|
objects (wsh/lookup-page-objects state page-id)
|
||||||
shapes (cph/get-immediate-children objects)
|
shapes (cph/get-immediate-children objects)
|
||||||
srect (gsh/selection-rect shapes)
|
srect (gsh/selection-rect shapes)
|
||||||
local (assoc local :vport size :zoom 1)]
|
local (assoc local :vport size :zoom 1 :zoom-inverse 1)]
|
||||||
(cond
|
(cond
|
||||||
(or (not (d/num? (:width srect)))
|
(or (not (d/num? (:width srect)))
|
||||||
(not (d/num? (:height srect))))
|
(not (d/num? (:height srect))))
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
zoom (/ (:width size) (:width srect))]
|
zoom (/ (:width size) (:width srect))]
|
||||||
(-> local
|
(-> local
|
||||||
(assoc :zoom zoom)
|
(assoc :zoom zoom)
|
||||||
|
(assoc :zoom-inverse (/ 1 zoom))
|
||||||
(update :vbox merge srect)))
|
(update :vbox merge srect)))
|
||||||
|
|
||||||
:else
|
:else
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
zoom (/ (:width vport) (:width srect))]
|
zoom (/ (:width vport) (:width srect))]
|
||||||
(-> local
|
(-> local
|
||||||
(assoc :zoom zoom)
|
(assoc :zoom zoom)
|
||||||
|
(assoc :zoom-inverse (/ 1 zoom))
|
||||||
(update :vbox merge srect))))))))))
|
(update :vbox merge srect))))))))))
|
||||||
|
|
||||||
(def zoom-to-selected-shape
|
(def zoom-to-selected-shape
|
||||||
|
@ -103,6 +104,7 @@
|
||||||
zoom (/ (:width vport) (:width srect))]
|
zoom (/ (:width vport) (:width srect))]
|
||||||
(-> local
|
(-> local
|
||||||
(assoc :zoom zoom)
|
(assoc :zoom zoom)
|
||||||
|
(assoc :zoom-inverse (/ 1 zoom))
|
||||||
(update :vbox merge srect)))))))))))
|
(update :vbox merge srect)))))))))))
|
||||||
|
|
||||||
(defn start-zooming [pt]
|
(defn start-zooming [pt]
|
||||||
|
|
Loading…
Add table
Reference in a new issue