Set Text to the Vertical Center of the field
Richard Gaskin
ambassador at fourthworld.com
Sat Apr 2 14:34:00 EDT 2016
Ive tried several of the methods discussed here and one of my own, and
while some work at some field heights they break at others.
I didn't use fixedLineHeight because that shouldn't be needed; indeed I
can imagine many cases in which a field may have different sizes of
text, so we need a solution that allows that.
IMNSO if this can't be done in three lines using Jacque's method it's a bug.
put the formattedheight of line 1 to -1 of me into tTotalTextHt
put ( ( the height of me - tTotalTextHt ) / 2) into tTopMargin
set topmargin of me to tTopMargin
Logically that should work regardless of text size or fixedLineHeight.
Can anyone here think of a reason it might not be considered a bug?
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list