mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 06:19:36 +00:00
Move metrics computation close to drawing for drawStrRed/Black
This commit is contained in:
parent
a02bfeebc5
commit
b0b8e5f54c
@ -218,7 +218,7 @@ void InsetMathMakebox::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
|
||||
Dimension wdim;
|
||||
static docstring bracket = from_ascii("[");
|
||||
mathed_string_dim(mi.base.font, bracket, wdim);
|
||||
metricsStrRedBlack(mi, wdim, bracket);
|
||||
int w = wdim.wid;
|
||||
|
||||
Dimension dim0;
|
||||
|
@ -44,7 +44,7 @@ Inset * InsetMathExFunc::clone() const
|
||||
|
||||
void InsetMathExFunc::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
mathed_string_dim(mi.base.font, name_, dim);
|
||||
metricsStrRedBlack(mi, dim, name_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ void InsetMathUnknown::normalize(NormalStream & os) const
|
||||
|
||||
void InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
mathed_string_dim(mi.base.font, name_, dim);
|
||||
metricsStrRedBlack(mi, dim, name_);
|
||||
docstring::const_reverse_iterator rit = name_.rbegin();
|
||||
kerning_ = mathed_char_kerning(mi.base.font, *rit);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ void MathMacroArgument::write(WriteStream & os) const
|
||||
|
||||
void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
mathed_string_dim(mi.base.font, str_, dim);
|
||||
metricsStrRedBlack(mi, dim, str_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -488,6 +488,12 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
|
||||
}
|
||||
|
||||
|
||||
void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & str)
|
||||
{
|
||||
mathed_string_dim(mi.base.font, str, dim);
|
||||
}
|
||||
|
||||
|
||||
void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str)
|
||||
{
|
||||
FontInfo f = pi.base.font;
|
||||
|
@ -40,6 +40,8 @@ void mathed_string_dim(FontInfo const & font,
|
||||
|
||||
int mathed_string_width(FontInfo const &, docstring const & s);
|
||||
|
||||
void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & s);
|
||||
|
||||
void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
|
||||
void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user