diff --git a/src/Perspex.SceneGraph/Media/PolylineGeometry.cs b/src/Perspex.SceneGraph/Media/PolylineGeometry.cs index 817d1d8012..0b431d6ae2 100644 --- a/src/Perspex.SceneGraph/Media/PolylineGeometry.cs +++ b/src/Perspex.SceneGraph/Media/PolylineGeometry.cs @@ -69,7 +69,6 @@ namespace Perspex.Media return new Rect(xMin, yMin, xMax - xMin, yMax - yMin); } } - public override Rect Bounds => PlatformImpl.Bounds; /// public override Geometry Clone() diff --git a/src/Skia/Perspex.Skia/DrawingContextImpl.cs b/src/Skia/Perspex.Skia/DrawingContextImpl.cs index d3fff009b7..8e7d481433 100644 --- a/src/Skia/Perspex.Skia/DrawingContextImpl.cs +++ b/src/Skia/Perspex.Skia/DrawingContextImpl.cs @@ -111,7 +111,7 @@ namespace Perspex.Skia { var brush = CreateBrush(pen.Brush, targetSize); brush.Brush->Stroke = true; - brush.Brush->StrokeThickness = (float)(pen.Thickness / ((Transform.M11 + Transform.M22) * 0.5)); + brush.Brush->StrokeThickness = (float)pen.Thickness; brush.Brush->StrokeLineCap = pen.StartLineCap; brush.Brush->StrokeLineJoin = pen.LineJoin; brush.Brush->StrokeMiterLimit = (float)pen.MiterLimit; diff --git a/tests/Perspex.RenderTests/Shapes/PolygonTests.cs b/tests/Perspex.RenderTests/Shapes/PolygonTests.cs index dd1db5bd06..94f6bf584a 100644 --- a/tests/Perspex.RenderTests/Shapes/PolygonTests.cs +++ b/tests/Perspex.RenderTests/Shapes/PolygonTests.cs @@ -21,7 +21,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes { } +#if PERSPEX_CAIRO + [Fact(Skip = "Caused by cairo bug")] +#else [Fact] +#endif public void Polygon_1px_Stroke() { Decorator target = new Decorator @@ -43,7 +47,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes CompareImages(); } +#if PERSPEX_CAIRO + [Fact(Skip = "Caused by cairo bug")] +#else [Fact] +#endif public void Polygon_NonUniformFill() { Decorator target = new Decorator diff --git a/tests/Perspex.RenderTests/Shapes/PolylineTests.cs b/tests/Perspex.RenderTests/Shapes/PolylineTests.cs index 72aac1b0f8..ca91be8e4b 100644 --- a/tests/Perspex.RenderTests/Shapes/PolylineTests.cs +++ b/tests/Perspex.RenderTests/Shapes/PolylineTests.cs @@ -21,7 +21,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes { } +#if PERSPEX_CAIRO + [Fact(Skip = "Caused by cairo bug")] +#else [Fact] +#endif public void Polyline_1px_Stroke() { var polylinePoints = new Point[] { new Point(0, 0), new Point(5, 0), new Point(6, -2), new Point(7, 3), new Point(8, -3), @@ -45,7 +49,11 @@ namespace Perspex.Direct2D1.RenderTests.Shapes CompareImages(); } +#if PERSPEX_CAIRO + [Fact(Skip = "Caused by cairo bug")] +#else [Fact] +#endif public void Polyline_10px_Stroke_PenLineJoin() { var polylinePoints = new Point[] { new Point(0, 0), new Point(5, 0), new Point(6, -2), new Point(7, 3), new Point(8, -3), diff --git a/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_1px_Stroke.expected.png b/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_1px_Stroke.expected.png index 2989e4bac4..f62be2d4bf 100644 Binary files a/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_1px_Stroke.expected.png and b/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_1px_Stroke.expected.png differ diff --git a/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_NonUniformFill.expected.png b/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_NonUniformFill.expected.png new file mode 100644 index 0000000000..0888c74c30 Binary files /dev/null and b/tests/TestFiles/Cairo/Shapes/Polygon/Polygon_NonUniformFill.expected.png differ diff --git a/tests/TestFiles/Cairo/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png b/tests/TestFiles/Cairo/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png new file mode 100644 index 0000000000..d908a572cb Binary files /dev/null and b/tests/TestFiles/Cairo/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png differ diff --git a/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_1px_Stroke.expected.png b/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_1px_Stroke.expected.png index 2989e4bac4..f62be2d4bf 100644 Binary files a/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_1px_Stroke.expected.png and b/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_1px_Stroke.expected.png differ diff --git a/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_NonUniformFill.expected.png b/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_NonUniformFill.expected.png new file mode 100644 index 0000000000..0888c74c30 Binary files /dev/null and b/tests/TestFiles/Direct2D1/Shapes/Polygon/Polygon_NonUniformFill.expected.png differ diff --git a/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png b/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png new file mode 100644 index 0000000000..d908a572cb Binary files /dev/null and b/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png differ diff --git a/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_1px_Stroke.expected.png b/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_1px_Stroke.expected.png index 7cbe87fa6c..544d9e2320 100644 Binary files a/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_1px_Stroke.expected.png and b/tests/TestFiles/Direct2D1/Shapes/Polyline/Polyline_1px_Stroke.expected.png differ diff --git a/tests/TestFiles/Skia/Shapes/Polygon/Polygon_1px_Stroke.expected.png b/tests/TestFiles/Skia/Shapes/Polygon/Polygon_1px_Stroke.expected.png index 2989e4bac4..f62be2d4bf 100644 Binary files a/tests/TestFiles/Skia/Shapes/Polygon/Polygon_1px_Stroke.expected.png and b/tests/TestFiles/Skia/Shapes/Polygon/Polygon_1px_Stroke.expected.png differ diff --git a/tests/TestFiles/Skia/Shapes/Polygon/Polygon_NonUniformFill.expected.png b/tests/TestFiles/Skia/Shapes/Polygon/Polygon_NonUniformFill.expected.png new file mode 100644 index 0000000000..0888c74c30 Binary files /dev/null and b/tests/TestFiles/Skia/Shapes/Polygon/Polygon_NonUniformFill.expected.png differ diff --git a/tests/TestFiles/Skia/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png b/tests/TestFiles/Skia/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png new file mode 100644 index 0000000000..d908a572cb Binary files /dev/null and b/tests/TestFiles/Skia/Shapes/Polyline/Polyline_10px_Stroke_PenLineJoin.expected.png differ diff --git a/tests/TestFiles/Skia/Shapes/Polyline/Polyline_1px_Stroke.expected.png b/tests/TestFiles/Skia/Shapes/Polyline/Polyline_1px_Stroke.expected.png index 7cbe87fa6c..544d9e2320 100644 Binary files a/tests/TestFiles/Skia/Shapes/Polyline/Polyline_1px_Stroke.expected.png and b/tests/TestFiles/Skia/Shapes/Polyline/Polyline_1px_Stroke.expected.png differ