Updated ToggleButton and CheckBox width/height handling

This commit is contained in:
2019-06-25 15:33:58 -05:00
parent a972cfac98
commit b3bfa0d654
2 changed files with 4 additions and 4 deletions

View File

@@ -11,9 +11,6 @@ module CyberarmEngine
add(@toggle_button) add(@toggle_button)
add(@label) add(@label)
@style.width = @toggle_button.width + @label.width
@style.height = @toggle_button.height + @label.height
end end
def text=(text) def text=(text)

View File

@@ -38,7 +38,10 @@ module CyberarmEngine
def recalculate def recalculate
super super
@style.width = @text.textobject.text_width(@options[:checkmark]) _width = dimensional_size(@style.width, :width)
_height= dimensional_size(@style.height,:height)
@width = _width ? _width : @text.textobject.text_width(@options[:checkmark])
@height = _height ? _height : @text.height
update_background update_background
end end