mirror of https://github.com/anoshenko/rui.git
Fixed crash while setting views "clip" property from resource file.
This commit is contained in:
parent
32f0f83ebf
commit
8f0a8ebd54
|
@ -461,6 +461,7 @@ func parseClipShape(obj DataObject) ClipShape {
|
||||||
switch obj.Tag() {
|
switch obj.Tag() {
|
||||||
case "inset":
|
case "inset":
|
||||||
clip := new(insetClip)
|
clip := new(insetClip)
|
||||||
|
clip.init()
|
||||||
for _, tag := range []string{Top, Right, Bottom, Left, Radius, RadiusX, RadiusY} {
|
for _, tag := range []string{Top, Right, Bottom, Left, Radius, RadiusX, RadiusY} {
|
||||||
if value, ok := obj.PropertyValue(tag); ok {
|
if value, ok := obj.PropertyValue(tag); ok {
|
||||||
clip.Set(tag, value)
|
clip.Set(tag, value)
|
||||||
|
@ -470,6 +471,7 @@ func parseClipShape(obj DataObject) ClipShape {
|
||||||
|
|
||||||
case "circle":
|
case "circle":
|
||||||
clip := new(ellipseClip)
|
clip := new(ellipseClip)
|
||||||
|
clip.init()
|
||||||
for _, tag := range []string{X, Y, Radius} {
|
for _, tag := range []string{X, Y, Radius} {
|
||||||
if value, ok := obj.PropertyValue(tag); ok {
|
if value, ok := obj.PropertyValue(tag); ok {
|
||||||
clip.Set(tag, value)
|
clip.Set(tag, value)
|
||||||
|
@ -479,6 +481,7 @@ func parseClipShape(obj DataObject) ClipShape {
|
||||||
|
|
||||||
case "ellipse":
|
case "ellipse":
|
||||||
clip := new(ellipseClip)
|
clip := new(ellipseClip)
|
||||||
|
clip.init()
|
||||||
for _, tag := range []string{X, Y, RadiusX, RadiusY} {
|
for _, tag := range []string{X, Y, RadiusX, RadiusY} {
|
||||||
if value, ok := obj.PropertyValue(tag); ok {
|
if value, ok := obj.PropertyValue(tag); ok {
|
||||||
clip.Set(tag, value)
|
clip.Set(tag, value)
|
||||||
|
@ -488,6 +491,7 @@ func parseClipShape(obj DataObject) ClipShape {
|
||||||
|
|
||||||
case "polygon":
|
case "polygon":
|
||||||
clip := new(ellipseClip)
|
clip := new(ellipseClip)
|
||||||
|
clip.init()
|
||||||
if value, ok := obj.PropertyValue(Points); ok {
|
if value, ok := obj.PropertyValue(Points); ok {
|
||||||
clip.Set(Points, value)
|
clip.Set(Points, value)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue