mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-15 04:32:35 +00:00
Added more triggers for repainting
This commit is contained in:
@@ -258,6 +258,8 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
def enabled=(boolean)
|
||||
root.gui_state.request_repaint if @enabled != boolean
|
||||
|
||||
@enabled = boolean
|
||||
|
||||
recalculate
|
||||
|
||||
@@ -80,16 +80,22 @@ module CyberarmEngine
|
||||
@show_caret = true
|
||||
@caret_last_interval = Gosu.milliseconds
|
||||
|
||||
root.gui_state.request_repaint
|
||||
|
||||
publish(:changed, value)
|
||||
end
|
||||
|
||||
if @last_caret_position != @text_input.caret_pos
|
||||
@last_caret_position = @text_input.caret_pos
|
||||
root.gui_state.request_repaint
|
||||
|
||||
@show_caret = true
|
||||
@caret_last_interval = Gosu.milliseconds
|
||||
end
|
||||
|
||||
if Gosu.milliseconds >= @caret_last_interval + @caret_interval
|
||||
root.gui_state.request_repaint
|
||||
|
||||
@caret_last_interval = Gosu.milliseconds
|
||||
|
||||
@show_caret = !@show_caret
|
||||
|
||||
@@ -77,9 +77,13 @@ module CyberarmEngine
|
||||
def value=(decimal)
|
||||
raise "value must be number" unless decimal.is_a?(Numeric)
|
||||
|
||||
old_value = @fraction
|
||||
|
||||
@fraction = decimal.clamp(0.0, 1.0)
|
||||
update_background
|
||||
|
||||
root.gui_state.request_repaint if @fraction != old_value
|
||||
|
||||
publish(:changed, @fraction)
|
||||
@fraction
|
||||
end
|
||||
|
||||
@@ -57,7 +57,7 @@ module CyberarmEngine
|
||||
@menu.draw
|
||||
end
|
||||
|
||||
if @tip.value.length.positive?
|
||||
if @tip && @tip.value.length.positive?
|
||||
Gosu.flush
|
||||
|
||||
@tip.draw
|
||||
|
||||
Reference in New Issue
Block a user