Commit 3237abc1 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #121 from Stardraw/master

Parse Exponent stop-opacity
Showing with 15 additions and 4 deletions
+15 -4
......@@ -710,13 +710,17 @@ namespace ExCSS
}
private Block NumberFraction(char current)
{
{
while (true)
{
if (current.IsDigit())
{
_buffer.Append(current);
}
else if ("eE%-".IndexOf(current) >= 0)
{
break;
}
else if (current.IsNameStart())
{
var number = FlushBuffer();
......
......@@ -124,6 +124,10 @@ namespace Svg.FilterEffects
var inflate = 0.5f;
var transform = GetTransform(element);
var bounds = GetPathBounds(element, renderer, transform);
if (bounds.Width == 0 || bounds.Height == 0)
return;
var buffer = new ImageBuffer(bounds, inflate, renderer, renderMethod) { Transform = transform };
IEnumerable<SvgFilterPrimitive> primitives = this.Children.OfType<SvgFilterPrimitive>();
......@@ -137,7 +141,7 @@ namespace Svg.FilterEffects
// Render the final filtered image
var bufferImg = buffer.Buffer;
bufferImg.Save(@"C:\test.png");
//bufferImg.Save(@"C:\test.png");
var imgDraw = RectangleF.Inflate(bounds, inflate * bounds.Width, inflate * bounds.Height);
var prevClip = renderer.GetClip();
renderer.SetClip(new Region(imgDraw));
......
......@@ -33,7 +33,10 @@ namespace Svg.FilterEffects
public override void Process(ImageBuffer buffer)
{
var inputImage = buffer[this.Input];
var inputImage = buffer[this.Input];
if (inputImage == null)
return;
float[][] colorMatrixElements;
float value;
......@@ -75,7 +78,7 @@ namespace Svg.FilterEffects
};
break;
default: // Matrix
var parts = this.Values.Split(new char[] { ' ', '\t', '\n', '\r', ',' });
var parts = this.Values.Replace(" ", " ").Split(new char[] { ' ', '\t', '\n', '\r', ',' });
colorMatrixElements = new float[5][];
for (int i = 0; i < 4; i++)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment