commit fd1866c368d6f70c2b9222d881b1d448d9643949
Author: Koji Yokota <[email protected]>
Date: Fri May 2 17:47:37 2025 +0900
Simplifying metrics calculus
---
src/mathed/InsetMathIntertext.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/mathed/InsetMathIntertext.cpp
b/src/mathed/InsetMathIntertext.cpp
index b992c643b2..b412566f3f 100644
--- a/src/mathed/InsetMathIntertext.cpp
+++ b/src/mathed/InsetMathIntertext.cpp
@@ -63,14 +63,14 @@ void InsetMathIntertext::metrics(MetricsInfo & mi,
Dimension & dim) const
void InsetMathIntertext::draw(PainterInfo & pi, int x, int y) const
{
Changer dummy = pi.base.changeFontSet("text");
- // in sync with InsetMathHull::draw
Dimension const dim = dimension(*pi.base.bv);
- int texty;
+ int text_y;
if (name_ == "shortintertext")
- texty = y - (dim.asc - dim.des - spacer_) + spacer_;
+ // note that dim is already updated in metrics()
+ text_y = y - dim.asc + dim.des + 2 * spacer_;
else
- texty = y - (dim.asc - 2*dim.des - 2*spacer_) + 2*spacer_;
- cell(0).draw(pi, (pi.leftx + x)/2, texty);
+ text_y = y - dim.asc + 2 * dim.des + 4 * spacer_;
+ cell(0).draw(pi, (pi.leftx + x)/2, text_y);
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs