mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
The check for Color_math would fail if the font color is changed
in mathed, so implement a strategy which is immune to color changes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34311 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
26ebe0865c
commit
dbb5ac93ea
@ -22,6 +22,7 @@
|
||||
#include "LaTeXFeatures.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
#include "support/docstring.h"
|
||||
#include "support/lassert.h"
|
||||
|
||||
#include <ostream>
|
||||
@ -105,7 +106,7 @@ InsetMath::mode_type InsetMathDecoration::currentMode() const
|
||||
void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
bool const upshape = currentMode() == TEXT_MODE
|
||||
&& mi.base.font.color() == Color_math;
|
||||
&& isMathFont(from_ascii(mi.base.fontname));
|
||||
ShapeChanger dummy(mi.base.font, upshape ?
|
||||
UP_SHAPE : mi.base.font.shape());
|
||||
|
||||
@ -129,7 +130,7 @@ void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
bool const upshape = currentMode() == TEXT_MODE
|
||||
&& pi.base.font.color() == Color_math;
|
||||
&& isMathFont(from_ascii(pi.base.fontname));
|
||||
ShapeChanger dummy(pi.base.font, upshape ?
|
||||
UP_SHAPE : pi.base.font.shape());
|
||||
|
||||
|
@ -646,6 +646,13 @@ bool isFontName(docstring const & name)
|
||||
}
|
||||
|
||||
|
||||
bool isMathFont(docstring const & name)
|
||||
{
|
||||
fontinfo * f = lookupFont(name);
|
||||
return f && f->color_ == Color_math;
|
||||
}
|
||||
|
||||
|
||||
FontInfo getFont(docstring const & name)
|
||||
{
|
||||
FontInfo font;
|
||||
|
@ -49,6 +49,8 @@ void augmentFont(FontInfo & f, docstring const & cmd);
|
||||
|
||||
bool isFontName(docstring const & name);
|
||||
|
||||
bool isMathFont(docstring const & name);
|
||||
|
||||
// converts single cell to string
|
||||
docstring asString(MathData const & ar);
|
||||
// converts single inset to string
|
||||
|
Loading…
Reference in New Issue
Block a user