add scale to each image in Images components

This commit is contained in:
2022-07-05 00:14:17 +00:00
parent d51940f1fc
commit 0d0f7b01d5
6 changed files with 68 additions and 19 deletions

View File

@@ -109,3 +109,10 @@
(withWritableComponents archive e [tags Tags]
(doFor tag tagsToRemove (tags.remove tag)))))
(function :Float getScale [:nat.Entry e]
(if (hasComponent e Images2)
(let [i2 (readComponent e Images2)]
(nth i2.imageScales i2.pinnedImageIndex))
(if (hasComponent e Scale)
(readComponent e Scale)
1.0)))