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: 
TheEndless
Channel Surfer

Re: Truncate Text on ImageCanvas

"jbrave" wrote:
Just a couple of comments: targetrect clipping may be the documented way it is supposed to work, but most programs that draw text in a scaleable rectangle wrap the text (microsoft word, adobe photoshop etc etc), so this is expected behavior for anyone who didn't read that page of the manual. I would hope that the wrap behavior does not change or you will probably break lots of channnels. Maybe add a wrap/clip switch with wrap as a default.

- Joel

Wrapping makes sense if the TargetRect is big enough to hold the text. What we're talking about here is the fact that the text isn't clipped, even if it overruns the bounds of the TargetRect.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
mike_ryan
Visitor

Re: Truncate Text on ImageCanvas

My expectation is that it would work similar to an HTML div with its CSS overflow property set to "hidden" where the text would wrap within the bounding box's width but clip on the height.

(Note in CSS you can set the white-space to nowrap which would clip the text on the width if the overflow is hidden)
0 Kudos
TheEndless
Channel Surfer

Re: Truncate Text on ImageCanvas

"mike.ryan" wrote:
My expectation is that it would work similar to an HTML div with its CSS overflow property set to "hidden" where the text would wrap within the bounding box's width but clip on the height.

(Note in CSS you can set the white-space to nowrap which would clip the text on the width if the overflow is hidden)

The strange thing is that the built-in UI elements behave exactly like that. Not sure why it's different on the image canvas.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
ljunkie
Visitor

Re: Truncate Text on ImageCanvas

Anyone found a solution for this? I am guessing one would have to check the width with GetOneLineWidth() and clip the txt if greater than bounding width?
0 Kudos