Browse Source

Added CubicBezierCurveRelative implementation option for path rendering.

Fixed ReadDouble (whitespaces processing).
Ivan Kochurkin 10 years ago
parent
commit
13d8263fa3
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/Perspex.SceneGraph/Media/PathMarkupParser.cs

+ 11 - 1
src/Perspex.SceneGraph/Media/PathMarkupParser.cs

@@ -150,6 +150,15 @@ namespace Perspex.Media
                                 break;
                             }
 
+                        case Command.CubicBezierCurveRelative:
+                            {
+                                Point point1 = ReadRelativePoint(reader, point);
+                                Point point2 = ReadRelativePoint(reader, point);
+                                _context.BezierTo(point, point1, point2);
+                                point = point2;
+                                break;
+                            }
+
                         case Command.Close:
                             _context.EndFigure(true);
                             openFigure = false;
@@ -202,8 +211,9 @@ namespace Perspex.Media
             }
         }
 
-        private static double ReadDouble(TextReader reader)
+        private static double ReadDouble(StringReader reader)
         {
+            ReadWhitespace(reader);
             // TODO: Handle Infinity, NaN and scientific notation.
             StringBuilder b = new StringBuilder();
             bool readSign = false;