Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RSGPro
Visitor

Issues With Scaling Label Nodes And Solutions

I recently created a custom component that extends from Rectangle. It had a single child that was a Label node with horiz and vert align fields set to center the text. I created another component that extended from this base component. In this new component, the rectangle would be scaled when a field was set. This should have also scaled the Label without issue. However, this is Roku we're talking about here. When I ran this on my Roku Ultra (4640X), it worked as intended. When I ran it on my Roku Express (3700X), the Label would no longer be centered after scaling. I found that explicitly setting the width and height of the label node to that of the boundingRect of the Rectangle, it fixed this issue on the Express. However, it introduced the same bug when I ran this change on my Ultra. After many hours of debugging, I found there is no ideal solution to this problem that works on both devices. I decided to make the base component extend from Group and separate the Rectangle and Label nodes. Then, I scaled the Rectangle without issue. For the Label node, I adjusted the size of the font. I attempted to scale the Label node as well but there seems to be some issue internally with the Express that prevents it from scaling Label nodes properly. Just wanted to share this in case someone else has run into similar issues. Feel free to comment if you have a better solution.
0 Kudos