Skip to content

Commit

Permalink
Strokes with zero width should not be painted (#798)
Browse files Browse the repository at this point in the history
Fix #797
  • Loading branch information
FeodorFitsner committed Oct 22, 2022
1 parent f1fff6b commit 215e0f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions example/assets/simple/zero_width_strokes.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added golden/simple/zero_width_strokes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion lib/src/vector_drawable.dart
Expand Up @@ -1293,7 +1293,10 @@ class DrawableShape implements DrawableStyleable {
canvas.drawPath(path, style.fill!.toFlutterPaint());
}

if (style.stroke?.color != null) {
if (style.stroke?.color != null &&
(style.stroke!.strokeWidth == null ||
(style.stroke!.strokeWidth != null &&
style.stroke!.strokeWidth! > 0))) {
assert(style.stroke!.style == PaintingStyle.stroke);
if (style.dashArray != null &&
!identical(style.dashArray, DrawableStyle.emptyDashArray)) {
Expand Down

0 comments on commit 215e0f4

Please sign in to comment.