On 12/20/2014, 12:41 PM, Geoff Canyon wrote:
If the formattedRect breaks on mobile, then that's a bug for the LC team,
but other than that, doesn't my two-line solution work? I'm not seeing a
way to break my two-line solution? What is the need for a more complex
solution?

It doesn't quite center correctly, at least not my multi-line wrapped field. It may have something to do with the calculations in the formatted* commands.

I found that by adding a small number of pixels to the top margin I could get it close, which is what Bernd was doing too. I've been trying to figure out where the problem is, but like him, I don't see anything offhand. I'm pretty sure the engine must either be adding padding to the top line, or else not reporting the underhang of the last line, which makes the formattedWhatever functions not quite exact.

BTW, I could reduce your calculation to a one-liner by using the formattedHeight instead of the formattedRect; it returns the same result -- which isn't quite right, but matches what you got.

set the topmargin of fld 1 to the height of fld 1 - the formattedheight of line 1 to -1 of fld 1

--
Jacqueline Landman Gay         |     [email protected]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to