Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Problem of wraping in layout

From: brett:codeconscious at: 14-Jan-2002 23:12

Hm... Well I've focussed Philippe's issue down to this code: system/view/vid/verbose: true spec: copy [origin 0x0 space 0x0] repeat i 5 [ append spec compose [ at (probe to-pair reduce [645 + i 20 * i]) text "Hello world!" ] ] win: layout/offset/size spec 0x0 800x600 view win Notice how the text sizing suddenly goes haywire. As far as I can tell, the text style tries to determine if it will fit inside the pane that it is being placed in. The problem is it makes this determination by considering only 90% (less offset and paragraph margin) of theavailable pane size. You can see the 90% ratio by using this code: print mold get in get-style 'text 'init All I can guess is that someone had a problem with text layout and text sizing... Any thoughts or a message to feedback? So a workaround is to initally position the text nowhere near the right had side - and then to move it to the correct position afterwards like this: spec: copy [ origin 0x0 space 0x0 t: text "Hello world!" do [t/offset: 729x200] ] win: layout/offset/size spec 0x0 800x600 HTH Brett.