6 Is A Mystery Number

Scott Rossi scott at tactilemedia.com
Sat Feb 18 00:05:15 EST 2012


The answer to life may be 42, but my question is: "6?"

The setup: I create a new scrolling field, fill it with a bunch of text, and
drag the scrollbar all the way down, setting the field to its max vertical
scroll.  When I compare the formattedHeight of the field minus its physical
height with the current vscroll of the field, I get a difference of 6. The
vscroll of the field is consistently 6 pixels less. Where does this value
come from?

No changes to margins, border, textHeight, or other visual properties seems
to have any bearing on this difference.  Oddities like these make it
difficult to reliably interact with LC controls.

Even more odd: if I disable the vertical scrollbar, and set the vscroll of
the field to its max via script, then the difference becomes 5.  WTF?

Anyone know the source of these mysterious numbers?  I guess I'm going to
create a LiveCode property called "fudgeFactor" to account to account for
these inconsistencies:

 ask "What is the answer to life?"
 if it is not 42 then set the fudgeFactor of field "myScrollingField" to 6

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design






More information about the use-livecode mailing list