]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCollapsable.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetCollapsable.cpp
index c53b8a585007035e7f03dae350e4be441a7de508..654979df7f16116b1bdf393098ffd9eb095baf23 100644 (file)
@@ -195,8 +195,7 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
                int d = 0;
                docstring s = layout_.labelstring;
                theFontMetrics(font).rectText(s, w, a, d);
-               dim.wid = max(dim.wid, w);
-               dim.des += d;
+               dim.des += a + d;
                break;
                }
        case TopButton:
@@ -320,9 +319,10 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                        int d = 0;
                        docstring s = layout_.labelstring;
                        theFontMetrics(font).rectText(s, w, a, d);
-                       desc += d;
-                       pi.pain.rectText(x + (textdim.wid - w) / 2, y + desc + a,
+                       int const ww = max(textdim.wid, w);
+                       pi.pain.rectText(x + (ww - w) / 2, y + desc + a,
                                s, font, Color::none, Color::none);
+                       desc += d;
                }
 
                // a visual cue when the cursor is inside the inset