[LyX/master] Fix computation of InsetCollapsible's button dimension
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Sun Jun 21 14:55:33 UTC 2026
commit ba4682bd2860b08438b467c11c3f86b123976c15
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date: Sun Jun 21 16:41:09 2026 +0200
Fix computation of InsetCollapsible's button dimension
Fixes bug #13311.
---
src/insets/InsetCollapsible.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp
index 14ea0a9825..699d6172ea 100644
--- a/src/insets/InsetCollapsible.cpp
+++ b/src/insets/InsetCollapsible.cpp
@@ -257,9 +257,8 @@ void InsetCollapsible::metrics(MetricsInfo & mi, Dimension & dim) const
view_[&bv].openinlined_ = (textdim.wid + dim.wid) < mi.base.textwidth;
if (view_[&bv].openinlined_) {
// Correct for button width but remove spacing before frame
- dim.wid += textdim.wid - leftOffset(mi.base.bv) / 2;
- dim.des = max(dim.des - textdim.asc + dim.asc, textdim.des);
- dim.asc = textdim.asc;
+ dim += textdim;
+ dim.wid -= leftOffset(mi.base.bv) / 2;
} else {
dim.des += textdim.height() + topOffset(mi.base.bv);
dim.wid = max(dim.wid, textdim.wid);
More information about the lyx-cvs
mailing list