From 89a9fc4c5e5441297e75f7c450e9fe891d8807fe Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 29 Jul 2010 16:38:58 +0000 Subject: [PATCH] Implement independent output scaling for math images (and, I suppose, for any other sort of image for which we produce a preview on export, e.g., eventually, for InsetExternal). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35032 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/PreviewLoader.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index aa54254a67..e1435ea720 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -583,19 +583,22 @@ void PreviewLoader::Impl::startLoading(bool wait) return; } - double font_scaling_factor = 0.01 * lyxrc.dpi * lyxrc.zoom - * lyxrc.preview_scale_factor; + double const font_scaling_factor = + buffer_.isExporting() ? 75.0 * buffer_.params().html_math_img_scale + : 0.01 * lyxrc.dpi * lyxrc.zoom * lyxrc.preview_scale_factor; - // For XHTML image export, we need to control the background - // color here. - ColorCode bg = buffer_.isExporting() + // FIXME XHTML + // The colors should be customizable. + ColorCode const bg = buffer_.isExporting() ? Color_white : PreviewLoader::backgroundColor(); + ColorCode const fg = buffer_.isExporting() + ? Color_black : PreviewLoader::foregroundColor(); // The conversion command. ostringstream cs; cs << pconverter_->command << ' ' << pconverter_->to << ' ' << quoteName(latexfile.toFilesystemEncoding()) << ' ' << int(font_scaling_factor) << ' ' - << theApp()->hexName(PreviewLoader::foregroundColor()) << ' ' + << theApp()->hexName(fg) << ' ' << theApp()->hexName(bg); if (buffer_.params().useXetex) cs << " xelatex"; -- 2.39.5