Looking for more info on hScroll

Trevor DeVore lists at mangomultimedia.com
Fri Jul 30 20:28:00 EDT 2004


Hello there list,

I need to determine the percentage of the scroll of a group based on 
the current hScroll.  I am scaling graphics in a group (thus changing 
the formattedWidth) and need to set the hScroll to the value that will 
keep the same objects centered in the viewable area of the group after 
the scaling is done.  I've done some tests but can't figure out how to 
make all of my numbers match up to get a correct percentage.  Here is 
an example -

* I have a group with a formattedWidth of 1033 pixels.
* During testing the highest hScroll value when scrolling this group to 
the right is 630.
* The width of the group is 397 pixels so the formattedWidth of the 
group - the actual width of the group is 636 pixels.
* The borderWidth = 2, scrollbarWidth = 0 and margins = 0

I don't know where the 6 pixel difference comes from.  In tests with 
the groups formattedWidth set to other values the difference has ranged 
anywhere between 4 and 8 pixels.

Now you may be thinking to yourself "What is the big deal with 4 to 8 
pixels?  That probably won't affect your calculations that much." but I 
hate not understanding why something isn't working and I will have a 
miserable weekend if I don't find the answer ;-)

So does anybody know how to calculate a groups max hScroll based on its 
formattedWidth, width and other properties?

Thanks,

-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com



More information about the use-livecode mailing list