FormattedHeight of a field and its contents
Bob Sneidar
bobsneidar at iotecdigital.com
Thu Feb 1 10:32:30 EST 2018
I get 14 for line 1 and 22 for the field. Put that in your smipe and poke it! ;-)
Bob S
> On Jan 31, 2018, at 17:31 , David Epstein via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Is there somewhere an explanation of how a field’s textSize, borderWidth, margins, and formattedHeight interact?
>
> According to the dictionary entry for “formattedHeight”, a field’s formattedHeight is calculated “including top and bottom margins”, while the formattedHeight of a chunk is calculated “disregarding margins.”
>
> That does not seem consistent with these results for a field whose textSize is 16 and whose margin is 4:
>
> the formattedHeight of line 1 of fld 1 19
> the formattedHeight of line 1 to 2 of fld 1 38
> the formattedHeight of fld 1 15 if there’s one line of text
> the formattedHeight of fld 1 34 if there are two lines of text.
>
> Even though there are top and bottom margins of 4, the field’s formattedHeight is smaller, rather than larger, than the formattedHeight of its contents.
>
> A perhaps related question: Why does a field margin of zero clip the visible text at the top and left?
>
> Many thanks.
>
> David Epstein
More information about the use-livecode
mailing list