Someone sent me this solution off line..
on mouseUp CenterTextVertically "field 2" end mouseUp on CenterTextVertically myFld put the effective textHeight of myFld into tTextHeight put item 2 of the loc of myFld into tfield put the formattedRect of line 1 to - 1 of myFld into tFormatRect put item 4 of tFormatRect - item 2 of tFormatRect into tFormatHeight put tFormatHeight div 2 into tFormatHalfHeight put item 2 of tFormatRect into tCurrFormatTop put tfieldY - tCurrFormatTop into tCenterField_To_TopTextDiff set the topMargin of myFld to the topMargin of myFld + tCenterField_To_TopTextDiff - tFormatHalfHeight end CenterTextVertically But, agreed, it should be a 3 liner will you "bug it" for us? and this from Jacque > The formattedheight of the entire field apparently isn't the same as the > formattedheight of the totals of the lines. makes no sense to me... or at least it would be good to know the difference in precise terms. On April 2, 2016 at 8:34:25 AM, Richard Gaskin (ambassa...@fourthworld.com(mailto:ambassa...@fourthworld.com)) wrote: > 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? _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode