Background color for SVG

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Background color for SVG

Peter Weilbacher
I wonder if it is possible to access the background color at the place
of a SVG graphic in nsSVGCairoCanvas.cpp.
The reason behind this is that due to the way the display APIs under
OS/2 work I need to "clear" the area that is going to be used for the
SVG display. Currently, I just fill it with white, but using the
background color of the <svg> (or the browser default if none is set)
would be nicer. For now I do this (snipped from the end of
nsSVGCairoCanvas::Init):

     // clip to dirtyRect
     cairo_new_path(mCR);
     cairo_rectangle(mCR,
                     dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height);
     cairo_clip(mCR);
     cairo_new_path(mCR);
   #ifdef XP_OS2
     cairo_set_source_rgb(mCR, 1, 1, 1);
     cairo_rectangle(mCR, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height);
     cairo_fill(mCR);
   #endif
   
     return NS_OK;

We still hope that there is a way to solve this problem inside the cairo
port but for now this is the best bet...
--
Greetings,                                                             ^
   Peter.

_______________________________________________
Mozilla-svg mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-svg