diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index 247bbfb78a610d24497e12683337e02b6bdd61d5..a230238cae1ce93f252661730b0cdeef8cbe9eb8 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -5859,12 +5859,15 @@ function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text, p.style.setProperty("transform", "translate(0px, " + (zoom > 0 ? 0.5 : 0) + "px)"); p.style.setProperty("max-width", - width_spec !== 0 ? width_spec + "ch" : "60ch"); + width_spec > 0 ? width_spec + "ch" : "60ch"); p.style.setProperty("min-width", - width_spec <= 0 ? "3ch" : - (is_gop == 1 ? (width_spec - 5) + "px" : - width_spec + "ch")); - + width_spec == 0 ? "3ch" : + (is_gop == 1 ? width_spec + "px" : + (width_spec < 0 ? (-width_spec) + "px" : width_spec + "ch"))); + + if (is_gop == 1) { + p.style.setProperty("min-height", height_spec + "px"); + } // set backgroundimage for message box if (type === "msg") { shove_svg_background_data_into_css(patchwin[cid].window); diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c index b82f34701c7dc14e0206fdb1a7f91b4af8ce0f86..8fcef1f34fae8c91a4e1a309d22b339c2ddd8fb4 100644 --- a/pd/src/g_rtext.c +++ b/pd/src/g_rtext.c @@ -607,7 +607,12 @@ void rtext_activate(t_rtext *x, int state) } else { - widthspec = x->x_text->te_width; // width if any specified + int xmin, xmax, tmp; + gobj_getrect(&x->x_text->te_g, x->x_glist, &xmin, &tmp, &xmax, &tmp); + /* width if specified. If not, we send the bounding width as + a negative number */ + widthspec = (x->x_text->te_width ? x->x_text->te_width : -(xmax-xmin)); + /* signal with negative number that we don't have a heightspec */ heightspec = -1; // signal that we don't have a heightspec isgop = 0; }