Let math mu skips scale with zoom

This commit is contained in:
Guillaume Munch 2016-11-20 23:41:36 +01:00
parent a42c315e79
commit fdd09d6f51
2 changed files with 12 additions and 19 deletions

View File

@ -15,6 +15,7 @@
#include "InsetMathFont.h" #include "InsetMathFont.h"
#include "InsetMathSymbol.h" #include "InsetMathSymbol.h"
#include "Length.h"
#include "MathData.h" #include "MathData.h"
#include "MathParser.h" #include "MathParser.h"
#include "MathStream.h" #include "MathStream.h"
@ -533,25 +534,15 @@ int mathed_font_em(FontInfo const & font)
* above. * above.
*/ */
int mathed_thinmuskip(FontInfo font) int mathed_mu(FontInfo const & font, double mu)
{ {
font.setFamily(SYMBOL_FAMILY); MetricsBase mb(nullptr, font);
return support::iround(3.0 / 18 * theFontMetrics(font).em()); return Length(mu, Length::MU).inPixels(mb);
} }
int mathed_thinmuskip(FontInfo const & font) { return mathed_mu(font, 3.0); }
int mathed_medmuskip(FontInfo font) int mathed_medmuskip(FontInfo const & font) { return mathed_mu(font, 4.0); }
{ int mathed_thickmuskip(FontInfo const & font) { return mathed_mu(font, 5.0); }
font.setFamily(SYMBOL_FAMILY);
return support::iround(4.0 / 18 * theFontMetrics(font).em());
}
int mathed_thickmuskip(FontInfo font)
{
font.setFamily(SYMBOL_FAMILY);
return support::iround(5.0 / 18 * theFontMetrics(font).em());
}
int mathed_char_width(FontInfo const & font, char_type c) int mathed_char_width(FontInfo const & font, char_type c)

View File

@ -31,11 +31,13 @@ class latexkeys;
int mathed_font_em(FontInfo const &); int mathed_font_em(FontInfo const &);
int mathed_thinmuskip(FontInfo font); int mathed_mu(FontInfo const & font, double mu);
int mathed_medmuskip(FontInfo font); int mathed_thinmuskip(FontInfo const & font);
int mathed_thickmuskip(FontInfo font); int mathed_medmuskip(FontInfo const & font);
int mathed_thickmuskip(FontInfo const & font);
int mathed_char_width(FontInfo const &, char_type c); int mathed_char_width(FontInfo const &, char_type c);