mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Tidied up TODO comments, misc tweaks to Anim Editor
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
class UIControls::Label < UIControls::BaseControl
|
||||
attr_reader :text
|
||||
|
||||
LABEL_END_X = 80
|
||||
TEXT_OFFSET_Y = 5
|
||||
|
||||
def initialize(width, height, viewport, text)
|
||||
super(width, height, viewport)
|
||||
@text = text
|
||||
@@ -27,8 +24,10 @@ class UIControls::Label < UIControls::BaseControl
|
||||
super
|
||||
if @header
|
||||
draw_text_centered(self.bitmap, 0, TEXT_OFFSET_Y, width, @text)
|
||||
# Draw underline
|
||||
text_size = self.bitmap.text_size(@text)
|
||||
self.bitmap.fill_rect((width - text_size.width) / 2, TEXT_OFFSET_Y + text_size.height, text_size.width, 1, TEXT_COLOR)
|
||||
self.bitmap.fill_rect((width - text_size.width) / 2, TEXT_OFFSET_Y + text_size.height,
|
||||
text_size.width, 1, TEXT_COLOR)
|
||||
else
|
||||
draw_text(self.bitmap, 4, TEXT_OFFSET_Y, @text)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user