1
- using System ;
1
+ using SVGImage . SVG . Utils ;
2
+ using System ;
3
+ using System . Collections . Generic ;
2
4
using System . IO ;
3
- using System . Xml ;
4
5
using System . Linq ;
5
- using System . Collections . Generic ;
6
- using SVGImage . SVG . Utils ;
7
-
8
6
using System . Windows ;
9
7
using System . Windows . Media ;
10
8
using System . Windows . Media . Animation ;
9
+ using System . Xml ;
11
10
12
11
namespace SVGImage . SVG
13
12
{
14
13
using Animation ;
15
- using Shapes ;
16
14
using FileLoaders ;
17
-
15
+ using Shapes ;
16
+ using System . Globalization ;
17
+
18
18
/// <summary>
19
19
/// This is the class that creates the WPF Drawing object based on the information from the <see cref="SVG"/> class.
20
20
/// </summary>
@@ -261,8 +261,8 @@ internal DrawingGroup LoadGroup(IList<Shape> elements, Rect? viewBox, bool isSwi
261
261
{
262
262
var animation = new DoubleAnimation
263
263
{
264
- From = double . Parse ( animateTransform . From ) ,
265
- To = double . Parse ( animateTransform . To ) ,
264
+ From = double . Parse ( animateTransform . From , NumberStyles . Number , CultureInfo . InvariantCulture ) ,
265
+ To = double . Parse ( animateTransform . To , NumberStyles . Number , CultureInfo . InvariantCulture ) ,
266
266
Duration = animateTransform . Duration
267
267
} ;
268
268
animation . RepeatBehavior = RepeatBehavior . Forever ;
@@ -279,7 +279,7 @@ internal DrawingGroup LoadGroup(IList<Shape> elements, Rect? viewBox, bool isSwi
279
279
if ( animate . AttributeName == "r" )
280
280
{
281
281
var animation = new DoubleAnimationUsingKeyFrames ( ) { Duration = animate . Duration } ;
282
- foreach ( var d in animate . Values . Split ( ';' ) . Select ( x => new LinearDoubleKeyFrame ( double . Parse ( x ) ) ) )
282
+ foreach ( var d in animate . Values . Split ( ';' ) . Select ( x => new LinearDoubleKeyFrame ( double . Parse ( x , NumberStyles . Number , CultureInfo . InvariantCulture ) ) ) )
283
283
{
284
284
animation . KeyFrames . Add ( d ) ;
285
285
}
@@ -292,7 +292,7 @@ internal DrawingGroup LoadGroup(IList<Shape> elements, Rect? viewBox, bool isSwi
292
292
{
293
293
var animation = new PointAnimationUsingKeyFrames ( ) { Duration = animate . Duration } ;
294
294
foreach ( var d in animate . Values . Split ( ';' ) . Select ( _ => new LinearPointKeyFrame (
295
- new Point ( double . Parse ( _ ) , ( ( EllipseGeometry ) g ) . Center . Y ) ) ) )
295
+ new Point ( double . Parse ( _ , NumberStyles . Number , CultureInfo . InvariantCulture ) , ( ( EllipseGeometry ) g ) . Center . Y ) ) ) )
296
296
{
297
297
animation . KeyFrames . Add ( d ) ;
298
298
}
@@ -303,7 +303,7 @@ internal DrawingGroup LoadGroup(IList<Shape> elements, Rect? viewBox, bool isSwi
303
303
{
304
304
var animation = new PointAnimationUsingKeyFrames ( ) { Duration = animate . Duration } ;
305
305
foreach ( var d in animate . Values . Split ( ';' ) . Select ( _ => new LinearPointKeyFrame (
306
- new Point ( ( ( EllipseGeometry ) g ) . Center . X , double . Parse ( _ ) ) ) ) )
306
+ new Point ( ( ( EllipseGeometry ) g ) . Center . X , double . Parse ( _ , NumberStyles . Number , CultureInfo . InvariantCulture ) ) ) ) )
307
307
{
308
308
animation . KeyFrames . Add ( d ) ;
309
309
}
0 commit comments