Skip to content

Commit a8cdd6e

Browse files
committed
Bug fixes for reported issues
- Removed the default black fill for paths #38 - Added assembly location as search path for external files #43
1 parent 0103312 commit a8cdd6e

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Source/SVGImage/SVG/FileLoaders/FileSystemLoader.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public Stream LoadFile(string hRef, string svgFilename)
2424
if (File.Exists(filename))
2525
return File.OpenRead(filename);
2626

27+
// For the issue #43 : Environment.CurrentDirectory prevents msix packaging
28+
path = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
29+
filename = Path.Combine(path, hRef);
30+
if (File.Exists(filename))
31+
return File.OpenRead(filename);
32+
2733
Trace.TraceWarning("Unresolved URI: " + hRef);
2834

2935
return null;

Source/SVGImage/SVG/SVGImage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ static void OnSizeTypeChanged(DependencyObject d, DependencyPropertyChangedEvent
5757
{
5858
SVGImage ctrl = d as SVGImage;
5959
ctrl.RecalcImage();
60+
ctrl.InvalidateVisual();
6061
}
6162

6263
public eSizeType SizeType
@@ -301,6 +302,7 @@ public void SetImage(Drawing drawing)
301302
if (this.m_drawing != null && this.SizeType == eSizeType.SizeToContent)
302303
this.InvalidateMeasure();
303304
this.RecalcImage();
305+
this.InvalidateVisual();
304306
}
305307

306308
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)

Source/SVGImage/SVG/Shapes/PathShape.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public PathShape(SVG svg, XmlNode node, Shape parent) : base(svg, node, parent)
200200
if (DefaultFill == null)
201201
{
202202
DefaultFill = new Fill(svg);
203-
DefaultFill.PaintServerKey = svg.PaintServers.Parse("black");
203+
// DefaultFill.PaintServerKey = svg.PaintServers.Parse("black");
204204
}
205205

206206
this.ClosePath = false;

Tests/SvgTestSuites/Output/SvgTestSettings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<options>
33
<option name="HidePathsRoot" type="Boolean">false</option>
4-
<option name="SelectedValuePath" type="String"></option>
4+
<option name="SelectedValuePath" type="String">Colors/color-prop-05-t</option>
55
<testSuites>
66
<testSuite isDefault="false" isSelected="false">
77
<property name="Version">1.0</property>

0 commit comments

Comments
 (0)