mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 08:29:42 -05:00
🐛 Fix problems with z-index
This commit is contained in:
parent
790ce27316
commit
c43458af1d
2 changed files with 10 additions and 4 deletions
|
@ -211,14 +211,21 @@
|
||||||
;; Check which index is lower
|
;; Check which index is lower
|
||||||
:else
|
:else
|
||||||
;; If the base is a layout we should check if the z-index property is set
|
;; If the base is a layout we should check if the z-index property is set
|
||||||
(let [[z-index-a z-index-b]
|
(let [layer-order? (ctl/any-layout? objects base-id)
|
||||||
(if (ctl/any-layout? objects base-id)
|
[z-index-a z-index-b]
|
||||||
|
(if layer-order?
|
||||||
[(ctl/layout-z-index objects (dm/get-in objects [base-id :shapes index-a]))
|
[(ctl/layout-z-index objects (dm/get-in objects [base-id :shapes index-a]))
|
||||||
(ctl/layout-z-index objects (dm/get-in objects [base-id :shapes index-b]))]
|
(ctl/layout-z-index objects (dm/get-in objects [base-id :shapes index-b]))]
|
||||||
[0 0])]
|
[0 0])]
|
||||||
|
|
||||||
(if (= z-index-a z-index-b)
|
(cond
|
||||||
|
(and (= z-index-a z-index-b) (not layer-order?))
|
||||||
|
(< index-a index-b)
|
||||||
|
|
||||||
|
(and (= z-index-a z-index-b) layer-order?)
|
||||||
(> index-a index-b)
|
(> index-a index-b)
|
||||||
|
|
||||||
|
:else
|
||||||
(< z-index-a z-index-b))))))
|
(< z-index-a z-index-b))))))
|
||||||
|
|
||||||
(defn sort-z-index
|
(defn sort-z-index
|
||||||
|
|
|
@ -208,7 +208,6 @@
|
||||||
(let [objects (:objects data)
|
(let [objects (:objects data)
|
||||||
shapes (cfh/get-immediate-children objects)
|
shapes (cfh/get-immediate-children objects)
|
||||||
dim (calculate-dimensions objects aspect-ratio)
|
dim (calculate-dimensions objects aspect-ratio)
|
||||||
_ (prn ">>DIM" dim)
|
|
||||||
vbox (format-viewbox dim)
|
vbox (format-viewbox dim)
|
||||||
bgcolor (dm/get-in data [:options :background] default-color)
|
bgcolor (dm/get-in data [:options :background] default-color)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue