Re: bug in the label bbox
luigi scarso <[email protected]> Mon, 17 Aug 2020 16:09:17 +0200
| Newsgroups | gmane.comp.tex.metapost |
|---|---|
| Message-ID | <CAG5iGsBWbm=vef6C+LMARLU+yf2uGitWAa=0DpV_gAt8ic6o3g@mail.gmail.com> |
On Thu, Aug 6, 2020 at 8:28 PM Martin Budaj <[email protected]> wrote: > Hi, > > when using numbersystems other than scaled, the following example > fails to calculate the bounding box of an empty label (MetaPost > version 2.00): > > beginfig(1); > path q; > q:=bbox thelabel("",(0,0)); > message "BBOX: " & decimal xpart llcorner q & " " & > decimal ypart llcorner q & " " & > decimal xpart urcorner q & " " & > decimal ypart urcorner q; > endfig; > end > > The results are: > > scaled (OK, as bboxmargin is 2bp): > BBOX: -2 -2 2 2 > decimal: > BBOX: -2 -1E+1000000 2 1E+1000000 > binary: > BBOX: -2 -9.999999999999999999999999999999999E+999999 2 > 9.999999999999999999999 > 999999999999E+999999 > double: > ! Arithmetic overflow. > > Best regards > Martin > -- > http://tug.org/metapost/ > hm, in mp_set_text_box @<Set the height and depth to zero if the bounding box is empty@>= if (number_to_scaled(p->height) < -number_to_scaled(p->depth)) { set_number_to_zero(p->height); set_number_to_zero(p->depth); } works only for scaled mode, the others skip the test because number_to_scaled doesn't work if the value is neg_inf. I am doing some tests. -- luigi -- http://tug.org/metapost/