]> git.lyx.org Git - features.git/commitdiff
Take label width into account for SubLabel insets
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 15 Dec 2020 14:25:07 +0000 (15:25 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 15 Dec 2020 14:25:07 +0000 (15:25 +0100)
The drawing of the label should not go further than inset width.

Fixes bug #12046.

src/insets/InsetCollapsible.cpp

index f179afe72f54bd5f2a57fc5ff44c9ac7083d31e6..24aca669452a429c05a91f2728b324a816c75a81 100644 (file)
@@ -223,6 +223,7 @@ void InsetCollapsible::metrics(MetricsInfo & mi, Dimension & dim) const
                int d = 0;
                theFontMetrics(font).rectText(buttonLabel(bv), w, a, d);
                dim.des += a + d;
+               dim.wid = max(dim.wid, w);
                break;
                }
        case TopButton: