File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1847,9 +1847,10 @@ void TextBase::layoutFrame(LayoutData* ldata) const
18471847 }
18481848
18491849 if (rectangle ()) {
1850- // make sure width >= height, if only one row (basically: make square for single characters)
1851- if (ldata->frame .height () > ldata->frame .width () && ldata->rows () == 1 ) {
1852- double w = ldata->frame .height () - ldata->frame .width ();
1850+ // make sure width >= height, with min. width half the font's ascent
1851+ if (ldata->frame .height () > ldata->frame .width ()) {
1852+ FontMetrics fm = FontMetrics (font ());
1853+ double w = fmin (ldata->frame .height () - ldata->frame .width (), fm.ascent () * .5 );
18531854 ldata->frame .adjust (-w * .5 , 0.0 , w * .5 , 0.0 );
18541855 }
18551856 } else if (circle ()) {
You can’t perform that action at this time.
0 commit comments