Find the scroll location in wrapped field

James Hale james at thehales.id.au
Wed Nov 19 06:47:51 EST 2014


> 
> I am trying to build a special purpose e-Book where the user can shrink and 
> expand the text as needed with everything scaling, looking really nice 
> with fluid page turning.
> 
And this is why you want to locate the line. If I understand, you want the line that is positioned at the top of the field before a size change to be still at the top of the field after. This is not easy. Even Apple don't do it in iBooks.
I chose to break my text up into pages and on a text size change simply recalculate the paging. It would not be any significant extra to identify say the line at the top before the size change and then locate that line after and load it's possibly new page into the same window after. It wouldn't be at the top, but it would still be on the page they were looking at. Not as smooth as you describe but it might be the best you can do at this time. 
BTW the time to break up a long piece of text into pages is really pretty small. I haven't checked with v7 but with a lot of text it might be quicker than loading all the text in a single field given filling a field (which has taken a significant hit in moving through 6 to 7 from 5.5) now takes longer.

Whatever workaround you come up with would be worth sharing.

James 



More information about the use-livecode mailing list