commit c06789f8c8267840c26408e732ae381708fb816e
Author: Koji Yokota <[email protected]>
Date: Wed Sep 16 18:57:08 2026 +0900
Fix transparency background
Thanks to Pavel and Claude
---
lib/scripts/legacy_lyxpreview2ppm.py | 10 ----------
src/graphics/PreviewLoader.cpp | 9 +--------
src/mathed/InsetMathHull.cpp | 1 -
3 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/lib/scripts/legacy_lyxpreview2ppm.py
b/lib/scripts/legacy_lyxpreview2ppm.py
index 5d6e00ab1f..36d2e8fcee 100644
--- a/lib/scripts/legacy_lyxpreview2ppm.py
+++ b/lib/scripts/legacy_lyxpreview2ppm.py
@@ -280,16 +280,6 @@ def legacy_latex_file(latex_file, fg_color, bg_color):
""" % previewopts)
if bg_color != "transparent":
tmp.write(b"""
-\\ifdefined\\AddToHook
-
\\AddToHook{env/preview/before}{\\leavevmode\\begingroup\\special{ps::clippath
fill}}
- \\AddToHook{env/preview/after}{\\endgroup}
-\\else
- \\g@addto@macro\\preview{\\leavevmode\\begingroup\\special{ps::clippath
fill}}
- \\g@addto@macro\\endpreview{\\endgroup}
-\\fi
-""")
- else:
- tmp.write(b"""
\\ifdefined\\AddToHook
\\AddToHook{env/preview/before}{\\leavevmode\\begingroup\\color{lyxbg}\\special{background
\\current@color}\\special{ps::clippath fill}}
\\AddToHook{env/preview/after}{\\endgroup}
diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index e796739407..5cd2023470 100644
--- a/src/graphics/PreviewLoader.cpp
+++ b/src/graphics/PreviewLoader.cpp
@@ -680,14 +680,7 @@ void PreviewLoader::Impl::startLoading(bool wait)
// The colors should be customizable.
if (!buffer_.isExporting()) {
ColorCode const fg = PreviewLoader::foregroundColor();
- cs << " --fg " << theApp()->hexName(fg);
- ColorCode const bg = PreviewLoader::backgroundColor();
- ARGBColor const bga = argbFromHexName(
- lcolor.get32bitHexName(bg,
theApp()->isInDarkMode()));
- if (bga.a < 128)
- cs << " --bg \"transparent\"";
- else
- cs << " --bg " << theApp()->hexName(bg);
+ cs << " --fg " << theApp()->hexName(fg) << " --bg
\"transparent\"";
}
cs << latexparam;
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 170162b561..2ca494230f 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -615,7 +615,6 @@ ColorCode InsetMathHull::backgroundColor(PainterInfo const
& pi) const
Dimension const dim = dimension(*pi.base.bv);
if (previewTooSmall(dim))
return Color_error;
- return Color_transparent;
}
return InsetMath::backgroundColor(pi);
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs