0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-28 15:41:25 -05:00

🐛 Fix problem with fix scrolling on nested elements

This commit is contained in:
alonso.torres 2024-03-07 17:42:19 +01:00
parent 916d179009
commit 9a976a8f6e
3 changed files with 10 additions and 2 deletions

View file

@ -128,6 +128,7 @@
- Fix problem with shadow negative spread [Github #3421](https://github.com/penpot/penpot/issues/3421)
- Fix problem with linked colors to strokes [Github #3522](https://github.com/penpot/penpot/issues/3522)
- Fix problem with hand tool stuck [Github #3318](https://github.com/penpot/penpot/issues/3318)
- Fix problem with fix scrolling on nested elements [Github #3508](https://github.com/penpot/penpot/issues/3508)
## 1.19.5

View file

@ -762,6 +762,13 @@
(recur frame-id frame-parents (rest selected))))))
(defn fixed-scroll?
[shape]
^boolean
(and (:fixed-scroll shape)
(= (:parent-id shape) (:frame-id shape))
(not= (:frame-id shape) uuid/zero)))
(defn fixed?
[objects shape-id]
(let [ids-to-check
@ -772,4 +779,4 @@
(take-while #(and (not= % uuid/zero) (not (root-frame? objects %))))))]
(boolean
(->> ids-to-check
(d/seek (fn [id] (dm/get-in objects [id :fixed-scroll])))))))
(d/seek (fn [id] () (fixed-scroll? (get objects id))))))))

View file

@ -41,7 +41,7 @@
(defn get-fixed-ids
[objects]
(let [fixed-ids (filter :fixed-scroll (vals objects))
(let [fixed-ids (filter cfh/fixed-scroll? (vals objects))
;; we have to consider the children if the fixed element is a group
fixed-children-ids