[LyX/master] Take label width into account for SubLabel insets

Jean-Marc Lasgouttes lasgouttes at lyx.org
Tue Dec 15 13:57:44 UTC 2020


commit 3950f054977c60cdbf73c805cbd898003974aaee
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Tue Dec 15 15:25:07 2020 +0100

    Take label width into account for SubLabel insets
    
    The drawing of the label should not go further than inset width.
    
    Fixes bug #12046.
---
 src/insets/InsetCollapsible.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp
index f179afe..24aca66 100644
--- a/src/insets/InsetCollapsible.cpp
+++ b/src/insets/InsetCollapsible.cpp
@@ -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:


More information about the lyx-cvs mailing list