From 8f0a8ebd549f7a358a173cdc30584160d644aaf9 Mon Sep 17 00:00:00 2001 From: Mikalai Turankou Date: Mon, 2 Dec 2024 15:24:28 +0300 Subject: [PATCH] Fixed crash while setting views "clip" property from resource file. --- viewClip.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/viewClip.go b/viewClip.go index 574f01e..49ef93e 100644 --- a/viewClip.go +++ b/viewClip.go @@ -461,6 +461,7 @@ func parseClipShape(obj DataObject) ClipShape { switch obj.Tag() { case "inset": clip := new(insetClip) + clip.init() for _, tag := range []string{Top, Right, Bottom, Left, Radius, RadiusX, RadiusY} { if value, ok := obj.PropertyValue(tag); ok { clip.Set(tag, value) @@ -470,6 +471,7 @@ func parseClipShape(obj DataObject) ClipShape { case "circle": clip := new(ellipseClip) + clip.init() for _, tag := range []string{X, Y, Radius} { if value, ok := obj.PropertyValue(tag); ok { clip.Set(tag, value) @@ -479,6 +481,7 @@ func parseClipShape(obj DataObject) ClipShape { case "ellipse": clip := new(ellipseClip) + clip.init() for _, tag := range []string{X, Y, RadiusX, RadiusY} { if value, ok := obj.PropertyValue(tag); ok { clip.Set(tag, value) @@ -488,6 +491,7 @@ func parseClipShape(obj DataObject) ClipShape { case "polygon": clip := new(ellipseClip) + clip.init() if value, ok := obj.PropertyValue(Points); ok { clip.Set(Points, value) }