📚 Add comments on convoluted variants code (#6704)

This commit is contained in:
Pablo Alba 2025-06-17 16:17:56 +02:00 committed by GitHub
parent 01311225c7
commit 46fe3a6239
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1845,9 +1845,16 @@
;; If the values are already equal, don't copy them
(= (get previous-shape attr) (get current-shape attr))
;; If the referenced shape on the original component doesn't
;; have the same value, don't copy it
;; If both variants (origin and destiny) don't have the same value
;; for that attribute, don't copy it.
;; Exceptions: :points :selrect and :content can be different
;;
;; Sample:
;; 1. We have a variant with C1 (bg red) and C2 (bg blue).
;; 2. We make a copy of C1 called Copy.
;; 3. We set Copys bg to green (so it it has an override on the bg).
;; 4. We switch Copy to use C2 as base.
;; 5. The bg of Copy now is blue (we ignore the override)
(and
(not (contains? #{:points :selrect :content} attr))
(not= (get origin-ref-shape attr) (get current-shape attr)))