Hi all ๐ In certain cases, I would like to draw an image on top of a Text such that the image scales to fit the height and width of the Text component. I'm trying the following approach but I cannot find a way for the image to cover the whole Text component. Any pointers would be really helpful. See video in thread ๐งต
@ephemient wow! that seems to work perfectly. thanks so much ๐ Are there any performance improvements I could make ?
e
efemoney
11/14/2023, 1:16 PM
Are there any performance issues you are facing?
s
Shivam Verma
11/14/2023, 2:18 PM
@efemoney not particularly. I noticed another modifier ๐
drawWithCache
and was wondering if there was a way to use that instead for better performance
e
efemoney
11/14/2023, 2:22 PM
For your particular case there is nothing to โcacheโ.
The difference is that the withCache modifier gives you a lambda where you can first allocate (and hence cache) some objects that are then used across different runs of the actual draw operation. So expensive calculations, usually size-based calculations, can be done once and reused and will be rerun when the size changes for instance