lib/cyberarm_engine/ui/label.rb in cyberarm_engine-0.7.1 vs lib/cyberarm_engine/ui/label.rb in cyberarm_engine-0.8.0
- old
+ new
@@ -15,20 +15,14 @@
def clicked_left_mouse_button(sender, x, y)
@block.call(self) if @block
end
def recalculate
- unless @visible
- @width = 0
- @height= 0
- return
- end
+ @style.width = @text.width.round
+ @style.height= @text.height.round
- @width = @text.width.round
- @height= @text.height.round
-
- @text.x = @border_thickness_left + @padding_left + @x
- @text.y = @border_thickness_top + @padding_top + @y
+ @text.x = @style.border_thickness_left + @style.padding_left + @x
+ @text.y = @style.border_thickness_top + @style.padding_top + @y
@text.z = @z + 3
update_background
end
\ No newline at end of file