Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Source/Model/Primitives/SVGGradient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public class SVGLinearGradient: SVGGradient {
let width = bounds.width
let height = bounds.height
let maximum = max(width, height)

let offsetRect = model is SVGPolygon ? frame : bounds

return view
.foregroundColor(.clear)
.overlay(
Expand All @@ -81,7 +82,7 @@ public class SVGLinearGradient: SVGGradient {
.scaleEffect(CGSize(width: width/maximum, height: height/maximum))
}
.frame(width: width, height: height)
.offset(x: bounds.minX, y: bounds.minY)
.offset(x: offsetRect.minX, y: offsetRect.minY)
.mask(view)
)
}
Expand Down