forked from mbk-lab/rui_orig
Bug fixing
This commit is contained in:
parent
9a5fd64758
commit
a84be115fd
10
bounds.go
10
bounds.go
|
@ -260,6 +260,12 @@ func (properties *propertyList) setBounds(tag string, value any) bool {
|
||||||
case SizeUnit:
|
case SizeUnit:
|
||||||
properties.properties[tag] = value
|
properties.properties[tag] = value
|
||||||
|
|
||||||
|
case float32:
|
||||||
|
properties.properties[tag] = Px(float64(value))
|
||||||
|
|
||||||
|
case float64:
|
||||||
|
properties.properties[tag] = Px(value)
|
||||||
|
|
||||||
case Bounds:
|
case Bounds:
|
||||||
bounds := NewBoundsProperty(nil)
|
bounds := NewBoundsProperty(nil)
|
||||||
if value.Top.Type != Auto {
|
if value.Top.Type != Auto {
|
||||||
|
@ -292,10 +298,14 @@ func (properties *propertyList) setBounds(tag string, value any) bool {
|
||||||
properties.properties[tag] = bounds
|
properties.properties[tag] = bounds
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if n, ok := isInt(value); ok {
|
||||||
|
properties.properties[tag] = Px(float64(n))
|
||||||
|
} else {
|
||||||
notCompatibleType(tag, value)
|
notCompatibleType(tag, value)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,11 +406,11 @@ func IsCheckboxChecked(view View, subviewID string) bool {
|
||||||
// GetCheckboxVerticalAlign return the vertical align of a Checkbox subview: TopAlign (0), BottomAlign (1), CenterAlign (2)
|
// GetCheckboxVerticalAlign return the vertical align of a Checkbox subview: TopAlign (0), BottomAlign (1), CenterAlign (2)
|
||||||
// If the second argument (subviewID) is "" then a left position of the first argument (view) is returned
|
// If the second argument (subviewID) is "" then a left position of the first argument (view) is returned
|
||||||
func GetCheckboxVerticalAlign(view View, subviewID string) int {
|
func GetCheckboxVerticalAlign(view View, subviewID string) int {
|
||||||
return enumStyledProperty(view, subviewID, VerticalAlign, LeftAlign, false)
|
return enumStyledProperty(view, subviewID, CheckboxVerticalAlign, LeftAlign, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCheckboxHorizontalAlign return the vertical align of a Checkbox subview: LeftAlign (0), RightAlign (1), CenterAlign (2)
|
// GetCheckboxHorizontalAlign return the vertical align of a Checkbox subview: LeftAlign (0), RightAlign (1), CenterAlign (2)
|
||||||
// If the second argument (subviewID) is "" then a left position of the first argument (view) is returned
|
// If the second argument (subviewID) is "" then a left position of the first argument (view) is returned
|
||||||
func GetCheckboxHorizontalAlign(view View, subviewID string) int {
|
func GetCheckboxHorizontalAlign(view View, subviewID string) int {
|
||||||
return enumStyledProperty(view, subviewID, VerticalAlign, TopAlign, false)
|
return enumStyledProperty(view, subviewID, CheckboxHorizontalAlign, TopAlign, false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -645,7 +645,16 @@ func (properties *propertyList) setRadius(value any) bool {
|
||||||
properties.properties[Radius] = radius
|
properties.properties[Radius] = radius
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
case float32:
|
||||||
|
return properties.setRadius(Px(float64(value)))
|
||||||
|
|
||||||
|
case float64:
|
||||||
|
return properties.setRadius(Px(value))
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if n, ok := isInt(value); ok {
|
||||||
|
return properties.setRadius(Px(float64(n)))
|
||||||
|
}
|
||||||
notCompatibleType(Radius, value)
|
notCompatibleType(Radius, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue