lib/cyberarm_engine/ui/elements/label.rb in cyberarm_engine-0.10.2 vs lib/cyberarm_engine/ui/elements/label.rb in cyberarm_engine-0.11.0

- old
+ new

@@ -11,14 +11,19 @@ @text.draw end def clicked_left_mouse_button(sender, x, y) @block.call(self) if @block + + return :handled end def recalculate + @width, @height = 0, 0 + _width = dimensional_size(@style.width, :width) _height= dimensional_size(@style.height,:height) + @width = _width ? _width : @text.width.round @height= _height ? _height : @text.height.round @text.x = @style.border_thickness_left + @style.padding_left + @x @text.y = @style.border_thickness_top + @style.padding_top + @y \ No newline at end of file