Looking for more info on hScroll

Wouter wouter.abraham at pi.be
Sat Jul 31 11:37:26 CDT 2004

Looking for more info on hScroll
	• 	From: Trevor DeVore
	• 	 Subject: Looking for more info on hScroll
	• 	 Date: Fri, 30 Jul 2004 17:28:16 -0700


> 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.

Are the margins of the group still set to another value than 0?
They are by default set to 4 (and the showborder true also adds to the 
width of a group).

> 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


More information about the use-livecode mailing list