X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04ee05f92add0ab92ce08ecb827e3be41336aa06..fc5d9e38ee002c024be3019e37b63f1a1d88e7c2:/src/common/dcsvg.cpp diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 2d0b4dcbab..daafe55ff6 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -26,6 +26,7 @@ #include "wx/dcsvg.h" #include "wx/wfstream.h" +#include "wx/filename.h" #define wxSVG_DEBUG FALSE // or TRUE to see the calls being executed @@ -119,10 +120,12 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou write(s); s = wxT(" ")+ newline ; - write(s); - s.Printf ( wxT(" \n"), float(Width)/dpi*2.54, float(Height)/dpi*2.54, Width, Height ); + s = wxT("\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\"> ") + newline ; write(s); + s = wxT(" \n"), float(Width)/dpi*2.54, float(Height)/dpi*2.54, Width, Height ); + write(s); s = wxT("SVG Picture created as ") + wxFileNameFromPath(filename) + wxT(" ") + newline ; write(s); s = wxString (wxT("Picture generated by wxSVG ")) + wxSVGVersion + wxT(" ")+ newline ; @@ -576,7 +579,7 @@ void wxSVGFileDCImpl::NewGraphics () } sLast.Printf( wxT("stroke-width:%d\" \n transform=\"translate(%.2g %.2g) scale(%.2g %.2g)\">"), - w, (double)m_logicalOriginX, m_logicalOriginY, m_scaleX, m_scaleY ); + w, double(m_logicalOriginX), double(m_logicalOriginY), m_scaleX, m_scaleY ); s = sBrush + sPenCap + sPenJoin + sPenStyle + sLast + newline + sWarn; write(s); @@ -655,6 +658,10 @@ void wxSVGFileDCImpl::DoDrawBitmap(const class wxBitmap & bmp, wxCoord x, wxCoor //save it bool bPNG_OK = myBitmap.SaveFile(sPNG,wxBITMAP_TYPE_PNG); +// reference the bitmap from the SVG doc +// only use filename & ext + sPNG = sPNG.AfterLast(wxFileName::GetPathSeparator()); + // refrence the bitmap from the SVG doc int w = myBitmap.GetWidth(); int h = myBitmap.GetHeight();