On 4/1/2016 11:08 PM, Sannyasin Brahmanathaswami wrote:
on mouseup
set the textsize of me to 28
put the formattedheight of me into tTotalTextHeight
put ( ( the height of me - tTotalTextHeight ) / 2) into tTopBottomMargins
set topmargin of me to tTopBottomMargins
end mouseUp

But it doesn't and the vertical position varies depending on the number of 
lines.

Try this:

on verticalAlign
  put the formattedheight of line 1 to -1 of me into tTotalTextHeight
  put ( ( the height of me - tTotalTextHeight ) / 2) into tTopBottomMargins
  set topmargin of me to tTopBottomMargins
end verticalAlign

The formattedheight of the entire field apparently isn't the same as the formattedheight of the totals of the lines. At least, the above worked in my limited test.

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
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

Reply via email to