07-28-2021 01:47
07-28-2021 01:47
SDK:5.0.2
Device: Fitbit Versa3(36.128.5.38)
What does it do internally when I write code like below?
When foo is true, Will the rendering invoke twice? Or, combine into once?
Is it be better to write like below?
Answered! Go to the Best Answer.
07-28-2021 01:53
07-28-2021 01:53
I think the latter could be more efficient, because changing an element's x might result in the layout being recalculated each time. (Maybe it doesn't, if layouts are only recalculated after all of your code has finished.)
Although it's probably not what you want to do, you could write aGraphicsElement.x = foo? 20 : 10;
07-28-2021 01:53
07-28-2021 01:53
I think the latter could be more efficient, because changing an element's x might result in the layout being recalculated each time. (Maybe it doesn't, if layouts are only recalculated after all of your code has finished.)
Although it's probably not what you want to do, you could write aGraphicsElement.x = foo? 20 : 10;
07-28-2021 02:10
07-28-2021 02:10
@Gondwana
Thank you for your replay.
I think same thing.
I've been plotting to cut corners. But I' ll write right way.