Code

Added missing (and very important) file.
[inkscape.git] / src / extension / internal / cairo-render-context.cpp
index e9ac98df8e18a59c4c0bbaa80a799b11dbe20014..d1462e52e5e43ae663bd381a351c1aa84650a4e2 100644 (file)
@@ -1191,7 +1191,8 @@ CairoRenderContext::_createPatternForPaintServer(SPPaintServer const *const pain
 void
 CairoRenderContext::_setFillStyle(SPStyle const *const style, NRRect const *pbox)
 {
-    g_return_if_fail( style->fill.isColor()
+    g_return_if_fail( !style->fill.set
+                      || style->fill.isColor()
                       || style->fill.isPaintserver() );
 
     float alpha = SP_SCALE24_TO_FLOAT(style->fill_opacity.value);
@@ -1205,6 +1206,10 @@ CairoRenderContext::_setFillStyle(SPStyle const *const style, NRRect const *pbox
         sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
 
         cairo_set_source_rgba(_cr, rgb[0], rgb[1], rgb[2], alpha);
+
+    } else if (!style->fill.set) { // unset fill is black
+        cairo_set_source_rgba(_cr, 0, 0, 0, alpha);
+
     } else {
         g_assert( style->fill.isPaintserver()
                   || SP_IS_GRADIENT(SP_STYLE_FILL_SERVER(style))
@@ -1309,7 +1314,7 @@ CairoRenderContext::renderPathVector(Geom::PathVector const & pathv, SPStyle con
 
     bool no_fill = style->fill.isNone() || style->fill_opacity.value == 0;
     bool no_stroke = style->stroke.isNone() || style->stroke_width.computed < 1e-9 || 
-                    style->fill_opacity.value == 0;
+                    style->stroke_opacity.value == 0;
 
     if (no_fill && no_stroke)
         return true;