commit 394351a9684bff5f2abd2aac54b50f79e75f5c43
Author: Koji Yokota <[email protected]>
Date: Mon May 12 20:33:20 2025 +0900
Adjusting drawing dimensions of intertext
---
src/mathed/InsetMathIntertext.cpp | 11 +++++------
src/mathed/InsetMathIntertext.h | 2 +-
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/mathed/InsetMathIntertext.cpp
b/src/mathed/InsetMathIntertext.cpp
index 62ab98b322..8b9003b268 100644
--- a/src/mathed/InsetMathIntertext.cpp
+++ b/src/mathed/InsetMathIntertext.cpp
@@ -53,10 +53,9 @@ void InsetMathIntertext::metrics(MetricsInfo & mi, Dimension
& dim) const
Changer dummy = mi.base.changeFontSet("text");
cell(0).metrics(mi, dim);
if (name_ == "shortintertext")
- dim.asc += dim.asc + dim.des + spacer_;
+ dim.asc += 2 * dim.asc + dim.des + spacer_;
else
- dim.asc += 2 * (dim.asc + dim.des + spacer_);
- dim.des += 2;
+ dim.asc += 3 * dim.asc + 2 * (dim.des + spacer_);
}
@@ -65,11 +64,11 @@ void InsetMathIntertext::draw(PainterInfo & pi, int x, int
y) const
Changer dummy = pi.base.changeFontSet("text");
Dimension const dim = dimension(*pi.base.bv);
int text_y;
+ // note that dim.asc is already updated in metrics()
if (name_ == "shortintertext")
- // note that dim is already updated in metrics()
- text_y = y - dim.asc + dim.des + 2 * spacer_;
+ text_y = y - (dim.asc + dim.des + spacer_)/2;
else
- text_y = y - dim.asc + 2 * dim.des + 4 * spacer_;
+ text_y = y - (dim.asc - dim.des + spacer_)/2;
cell(0).draw(pi, x, text_y);
}
diff --git a/src/mathed/InsetMathIntertext.h b/src/mathed/InsetMathIntertext.h
index 41274c97e0..30db04c9ff 100644
--- a/src/mathed/InsetMathIntertext.h
+++ b/src/mathed/InsetMathIntertext.h
@@ -49,7 +49,7 @@ private:
Inset * clone() const override;
/// the string
docstring name_;
- int spacer_ = 2;
+ int spacer_ = 10;
};
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs