New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG - <g>
opacity is not handled correctly
#4363
Comments
https://github.com/mapnik/mapnik/tree/svg-group-render - initial group/element TODO:
|
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300">
<g stroke-width="20" fill="#ffff00">
<circle cx="150" cy="125" r="100" fill="#0000ff" stroke="#ff00ff"/>
<rect x="25" y="100" width="250" height="50" rx="10" ry="10" stroke="#008000"/>
</g>
</svg> <svg xmlns="http://www.w3.org/2000/svg" width="300" height="300">
<g opacity="0.5" stroke-width="20" fill="#ffff00">
<circle cx="150" cy="125" r="100" fill="#0000ff" stroke="#ff00ff"/>
<rect x="25" y="100" width="250" height="50" rx="10" ry="10" stroke="#008000"/>
</g>
</svg> <svg xmlns="http://www.w3.org/2000/svg" width="300" height="300">
<g opacity="0.5" stroke-width="20" fill="#ffff00">
<circle cx="150" cy="125" r="100" fill="#0000ff" stroke="#ff00ff" opacity="0.5"/>
<rect x="25" y="100" width="250" height="50" rx="10" ry="10" stroke="#008000" opacity="1"/>
</g>
</svg> <svg xmlns="http://www.w3.org/2000/svg" width="300" height="300">
<g opacity="0.5" stroke-width="20" fill="#ffff00">
<circle cx="150" cy="125" r="100" fill="#0000ff" stroke="#ff00ff"/>
<rect x="25" y="100" width="250" height="50" rx="10" ry="10" stroke="#008000" opacity="0.5"/>
</g>
</svg> |
@mathisloge https://github.com/mapnik/mapnik/actions/runs/3553784365/jobs/5969500737 |
@artemp I needed to export the predefined structs of the cpp. diff --git a/deps/agg/include/agg_pixfmt_rgba.h b/deps/agg/include/agg_pixfmt_rgba.h
index 40ddf6a07..225fdef69 100644
--- a/deps/agg/include/agg_pixfmt_rgba.h
+++ b/deps/agg/include/agg_pixfmt_rgba.h
@@ -24,6 +24,7 @@
#ifndef AGG_PIXFMT_RGBA_INCLUDED
#define AGG_PIXFMT_RGBA_INCLUDED
+#include <mapnik/config.hpp>
#include <cstring>
#include <cmath>
#include "agg_basics.h"
@@ -3166,6 +3167,10 @@ private:
+extern template struct MAPNIK_DECL comp_op_rgba_hue<agg::rgba8, agg::order_rgba>;
+extern template struct MAPNIK_DECL comp_op_rgba_saturation<agg::rgba8, agg::order_rgba>;
+extern template struct MAPNIK_DECL comp_op_rgba_color<agg::rgba8, agg::order_rgba>;
+extern template struct MAPNIK_DECL comp_op_rgba_value<agg::rgba8, agg::order_rgba>;
//-----------------------------------------------------------------------
typedef blender_rgba<rgba8, order_rgba> blender_rgba32; //----blender_rgba32 |
@mathisloge Great, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The opacity attribute specifies the transparency of an object or of a group of objects, that is, the degree to which the background behind the element is overlaid.
(https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/opacity)
opacity
attribute requires special considerations when processing SVG document.Example
Current (incorrect) rendering
Correct rendering - applying
<g>
opacity
when blending group elements into parent canvas.The text was updated successfully, but these errors were encountered: