inconsistent field appearance
Terry Judd
tsj at unimelb.edu.au
Tue Jun 1 19:10:33 EDT 2010
If you were prepared to set the height of the 'tramlines' dynamically then
you could use the following function to return the appropriate value based
on the true height of a visible lowercase z of the relevant font and size
(the test character must be visible as the function relies on the
mouseColor). Watch out for line wraps.
Terry...
put the formattedRect of [chunk expression for target character] into tRect
put zHeight(tRect) into tHeight
-- insert some routine to separate the 'tramlines' by tHeight
function zHeight pRect
put the mouseLoc into tM
put round((item 1 of pRect + item 3 of pRect)/2) into tX
put "" into tColorData
lock screen
repeat with i = (item 2 of pRect) to (item 4 of pRect)
set the screenMouseLoc to globalLoc((tX,i))
put i&comma&mouseColor() &cr after tColorData
end repeat
filter tColorData with "*,0,0,0" -- black points only
put (item 1 of line -1 of tColorData)-(item 1 of line 1 of tColorData)+2
set the screenMouseLoc to globalLoc(tM)
unlock screen
return ((item 1 of line -1 of tColorData)-(item 1 of line 1 of
tColorData)+2)
end zHeight
On 2/06/10 8:10 AM, "Nicolas Cueto" <niconiko at gmail.com> wrote:
>> How are you positioning the guidelines?
>
> The guidelines don't get positioned each time. I positioned them once
> during initial development and that's it.
>
> In more detail, I put the text in the field, drew the two lines, then
> manually nudged the lines until they looked in the right place, and
> finally locked their positions.
>
>
>> Can you use the formattedRect
>> property of an offscreen field to determine the correct positions?
>
> Didn't know about that property. I'll try.
>
>
>> Could you do a spot of preliminary 'image analysis'
>
> Thanks Terry, but that's way beyond what I'm up to.
>
> --
> Nicolas Cueto
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list