Skip to content

Commit

Permalink
Transform clip path when applied to a group (#794)
Browse files Browse the repository at this point in the history
* Transform clip path when applied to a group

Fix #136, #343, #566

* Golden test added
  • Loading branch information
FeodorFitsner committed Oct 24, 2022
1 parent 215e0f4 commit 791e624
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions example/assets/simple/clip_path_transform.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/clip_path_transform.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions lib/src/vector_drawable.dart
Expand Up @@ -1098,6 +1098,10 @@ class DrawableGroup implements DrawableStyleable, DrawableParent {

if (style?.clipPath?.isNotEmpty == true) {
for (Path clipPath in style!.clipPath!) {
if (transform != null) {
clipPath = clipPath.transform(transform!);
}

canvas.save();
canvas.clipPath(clipPath);
if (children!.length > 1) {
Expand Down

0 comments on commit 791e624

Please sign in to comment.