| ... |
... |
@@ -203,6 +203,8 @@ wxString GetPenPattern(const wxPen& pen) |
|
203
|
203
|
// these penstyles do not need a pattern.
|
|
204
|
204
|
break;
|
|
205
|
205
|
}
|
|
|
206
|
+ if (!s.empty())
|
|
|
207
|
+ s.Prepend(wxS(" "));
|
|
206
|
208
|
return s;
|
|
207
|
209
|
}
|
|
208
|
210
|
|
| ... |
... |
@@ -291,7 +293,7 @@ wxString GetBrushPattern(const wxBrush& brush) |
|
291
|
293
|
wxString brushStyle = GetBrushStyleName(brush);
|
|
292
|
294
|
|
|
293
|
295
|
if (!brushStyle.empty())
|
|
294
|
|
- s = wxString::Format(wxS("fill=\"url(#%s)\""), brushStyle);
|
|
|
296
|
+ s = wxString::Format(wxS(" fill=\"url(#%s)\""), brushStyle);
|
|
295
|
297
|
|
|
296
|
298
|
return s;
|
|
297
|
299
|
}
|
| ... |
... |
@@ -311,12 +313,10 @@ wxString GetRenderMode(wxSVGShapeRenderingMode style) |
|
311
|
313
|
mode = wxS("geometricPrecision");
|
|
312
|
314
|
break;
|
|
313
|
315
|
case wxSVG_SHAPE_RENDERING_AUTO:
|
|
314
|
|
- mode = wxS("auto");
|
|
315
|
|
- break;
|
|
|
316
|
+ return wxString();
|
|
316
|
317
|
}
|
|
317
|
318
|
|
|
318
|
|
- wxString s = wxString::Format(wxS("shape-rendering=\"%s\""), mode);
|
|
319
|
|
- return s;
|
|
|
319
|
+ return wxString::Format(wxS(" shape-rendering=\"%s\""), mode);
|
|
320
|
320
|
}
|
|
321
|
321
|
|
|
322
|
322
|
wxString CreateBrushFill(const wxBrush& brush, wxSVGShapeRenderingMode mode, wxString& patternName)
|
| ... |
... |
@@ -357,7 +357,7 @@ wxString CreateBrushFill(const wxBrush& brush, wxSVGShapeRenderingMode mode, wxS |
|
357
|
357
|
|
|
358
|
358
|
s += wxString::Format(wxS(" <pattern id=\"%s\" patternUnits=\"userSpaceOnUse\" width=\"8\" height=\"8\">\n"),
|
|
359
|
359
|
patternName);
|
|
360
|
|
- s += wxString::Format(wxS(" <path stroke=\"%s\" stroke-opacity=\"%s\" %s %s %s/>\n"),
|
|
|
360
|
+ s += wxString::Format(wxS(" <path stroke=\"%s\" stroke-opacity=\"%s\" %s %s%s/>\n"),
|
|
361
|
361
|
brushColourStr, NumStr(opacity), brushStrokeStr, pattern, GetRenderMode(mode));
|
|
362
|
362
|
s += wxS(" </pattern>\n");
|
|
363
|
363
|
}
|
| ... |
... |
@@ -698,8 +698,7 @@ void wxSVGFileDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) |
|
698
|
698
|
{
|
|
699
|
699
|
NewGraphicsIfNeeded();
|
|
700
|
700
|
|
|
701
|
|
- wxString s;
|
|
702
|
|
- s = wxString::Format(wxS(" <path d=\"M%d %d L%d %d\" %s %s/>\n"),
|
|
|
701
|
+ const wxString s = wxString::Format(wxS(" <path d=\"M%d %d L%d %d\"%s%s/>\n"),
|
|
703
|
702
|
x1, y1, x2, y2, GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
704
|
703
|
|
|
705
|
704
|
write(s);
|
| ... |
... |
@@ -713,9 +712,7 @@ void wxSVGFileDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset |
|
713
|
712
|
if (n > 1)
|
|
714
|
713
|
{
|
|
715
|
714
|
NewGraphicsIfNeeded();
|
|
716
|
|
- wxString s;
|
|
717
|
|
-
|
|
718
|
|
- s = wxString::Format(wxS(" <path d=\"M%d %d"),
|
|
|
715
|
+ wxString s = wxString::Format(wxS(" <path d=\"M%d %d"),
|
|
719
|
716
|
(points[0].x + xoffset), (points[0].y + yoffset));
|
|
720
|
717
|
|
|
721
|
718
|
if ( AreAutomaticBoundingBoxUpdatesEnabled() )
|
| ... |
... |
@@ -728,7 +725,7 @@ void wxSVGFileDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset |
|
728
|
725
|
CalcBoundingBox(points[i].x + xoffset, points[i].y + yoffset);
|
|
729
|
726
|
}
|
|
730
|
727
|
|
|
731
|
|
- s += wxString::Format(wxS("\" fill=\"none\" %s %s/>\n"),
|
|
|
728
|
+ s += wxString::Format(wxS("\" fill=\"none\"%s%s/>\n"),
|
|
732
|
729
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
733
|
730
|
|
|
734
|
731
|
write(s);
|
| ... |
... |
@@ -787,7 +784,7 @@ void wxSVGFileDCImpl::DoDrawSpline(const wxPointList* points) |
|
787
|
784
|
if ( AreAutomaticBoundingBoxUpdatesEnabled() )
|
|
788
|
785
|
CalcBoundingBox(wxRound(p2.m_x), wxRound(p2.m_y));
|
|
789
|
786
|
|
|
790
|
|
- s += wxString::Format("\" fill=\"none\" %s %s/>\n",
|
|
|
787
|
+ s += wxString::Format("\" fill=\"none\"%s%s/>\n",
|
|
791
|
788
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
792
|
789
|
write(s);
|
|
793
|
790
|
}
|
| ... |
... |
@@ -912,7 +909,7 @@ void wxSVGFileDCImpl::DoDrawRotatedText(const wxString& sText, wxCoord x, wxCoor |
|
912
|
909
|
#endif
|
|
913
|
910
|
|
|
914
|
911
|
s = wxString::Format(
|
|
915
|
|
- wxS(" <rect x=\"%s\" y=\"%s\" width=\"%d\" height=\"%d\" %s %s transform=\"%s\"/>\n"),
|
|
|
912
|
+ wxS(" <rect x=\"%s\" y=\"%s\" width=\"%d\" height=\"%d\"%s %s transform=\"%s\"/>\n"),
|
|
916
|
913
|
NumStr(xRect), NumStr(yRect), ww, hh,
|
|
917
|
914
|
GetRenderMode(m_writer->GetShapeRenderingMode()), rectStyle, rectTransform);
|
|
918
|
915
|
|
| ... |
... |
@@ -952,9 +949,7 @@ void wxSVGFileDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoo |
|
952
|
949
|
void wxSVGFileDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
|
|
953
|
950
|
{
|
|
954
|
951
|
NewGraphicsIfNeeded();
|
|
955
|
|
- wxString s;
|
|
956
|
|
-
|
|
957
|
|
- s = wxString::Format(wxS(" <rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" rx=\"%s\" %s %s %s/>\n"),
|
|
|
952
|
+ const wxString s = wxString::Format(wxS(" <rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" rx=\"%s\"%s%s%s/>\n"),
|
|
958
|
953
|
x, y, width, height, NumStr(radius),
|
|
959
|
954
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen), GetBrushPattern(m_brush));
|
|
960
|
955
|
|
| ... |
... |
@@ -981,7 +976,7 @@ void wxSVGFileDCImpl::DoDrawPolygon(int n, const wxPoint points[], |
|
981
|
976
|
CalcBoundingBox(points[i].x + xoffset, points[i].y + yoffset);
|
|
982
|
977
|
}
|
|
983
|
978
|
|
|
984
|
|
- s += wxString::Format(wxS("\" %s %s %s fill-rule=\"%s\"/>\n"),
|
|
|
979
|
+ s += wxString::Format(wxS("\"%s%s%s fill-rule=\"%s\"/>\n"),
|
|
985
|
980
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen), GetBrushPattern(m_brush),
|
|
986
|
981
|
fillStyle == wxODDEVEN_RULE ? wxS("evenodd") : wxS("nonzero"));
|
|
987
|
982
|
|
| ... |
... |
@@ -1037,8 +1032,7 @@ void wxSVGFileDCImpl::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord |
|
1037
|
1032
|
const double rh = height / 2.0;
|
|
1038
|
1033
|
const double rw = width / 2.0;
|
|
1039
|
1034
|
|
|
1040
|
|
- wxString s;
|
|
1041
|
|
- s = wxString::Format(wxS(" <ellipse cx=\"%s\" cy=\"%s\" rx=\"%s\" ry=\"%s\" %s %s"),
|
|
|
1035
|
+ wxString s = wxString::Format(wxS(" <ellipse cx=\"%s\" cy=\"%s\" rx=\"%s\" ry=\"%s\"%s%s"),
|
|
1042
|
1036
|
NumStr(x + rw), NumStr(y + rh), NumStr(rw), NumStr(rh),
|
|
1043
|
1037
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
1044
|
1038
|
s += wxS("/>\n");
|
| ... |
... |
@@ -1108,7 +1102,7 @@ void wxSVGFileDCImpl::DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, |
|
1108
|
1102
|
x1, y1, NumStr(r1), NumStr(r2), fArc, fSweep, x2, y2, line);
|
|
1109
|
1103
|
}
|
|
1110
|
1104
|
|
|
1111
|
|
- s += wxString::Format(wxS("\" %s %s/>\n"),
|
|
|
1105
|
+ s += wxString::Format(wxS("\"%s%s/>\n"),
|
|
1112
|
1106
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
1113
|
1107
|
|
|
1114
|
1108
|
write(s);
|
| ... |
... |
@@ -1200,7 +1194,7 @@ void wxSVGFileDCImpl::DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord |
|
1200
|
1194
|
NewGraphicsIfNeeded();
|
|
1201
|
1195
|
|
|
1202
|
1196
|
wxString arcFill = arcPath;
|
|
1203
|
|
- arcFill += wxString::Format(wxS(" L%s %s z\" %s %s/>\n"),
|
|
|
1197
|
+ arcFill += wxString::Format(wxS(" L%s %s z\"%s%s/>\n"),
|
|
1204
|
1198
|
NumStr(xc), NumStr(yc),
|
|
1205
|
1199
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
1206
|
1200
|
write(arcFill);
|
| ... |
... |
@@ -1209,7 +1203,7 @@ void wxSVGFileDCImpl::DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord |
|
1209
|
1203
|
wxDCBrushChanger setTransp(*GetOwner(), *wxTRANSPARENT_BRUSH);
|
|
1210
|
1204
|
NewGraphicsIfNeeded();
|
|
1211
|
1205
|
|
|
1212
|
|
- wxString arcLine = wxString::Format(wxS("%s\" %s %s/>\n"),
|
|
|
1206
|
+ wxString arcLine = wxString::Format(wxS("%s\"%s%s/>\n"),
|
|
1213
|
1207
|
arcPath, GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen));
|
|
1214
|
1208
|
write(arcLine);
|
|
1215
|
1209
|
|
| ... |
... |
@@ -1247,7 +1241,7 @@ void wxSVGFileDCImpl::DoGradientFillLinear(const wxRect& rect, |
|
1247
|
1241
|
s += wxS(" </linearGradient>\n");
|
|
1248
|
1242
|
s += wxS(" </defs>\n");
|
|
1249
|
1243
|
|
|
1250
|
|
- s += wxString::Format(wxS(" <rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"url(#gradient%zu)\" %s %s %s/>\n"),
|
|
|
1244
|
+ s += wxString::Format(wxS(" <rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"url(#gradient%zu)\"%s%s%s/>\n"),
|
|
1251
|
1245
|
rect.x, rect.y, rect.width, rect.height, gradId,
|
|
1252
|
1246
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen), GetBrushPattern(m_brush));
|
|
1253
|
1247
|
|
| ... |
... |
@@ -1287,7 +1281,7 @@ void wxSVGFileDCImpl::DoGradientFillConcentric(const wxRect& rect, |
|
1287
|
1281
|
s += wxS(" </radialGradient>\n");
|
|
1288
|
1282
|
s += wxS(" </defs>\n");
|
|
1289
|
1283
|
|
|
1290
|
|
- s += wxString::Format(wxS(" <rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"url(#gradient%zu)\" %s %s %s/>\n"),
|
|
|
1284
|
+ s += wxString::Format(wxS(" <rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"url(#gradient%zu)\"%s%s%s/>\n"),
|
|
1291
|
1285
|
rect.x, rect.y, rect.width, rect.height, gradId,
|
|
1292
|
1286
|
GetRenderMode(m_writer->GetShapeRenderingMode()), GetPenPattern(m_pen), GetBrushPattern(m_brush));
|
|
1293
|
1287
|
|