mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Make field planner request recalulate on mouse move
This commit is contained in:
@@ -80,12 +80,15 @@ module TAC
|
|||||||
@segment_thickness = 2
|
@segment_thickness = 2
|
||||||
|
|
||||||
@font = CyberarmEngine::Text.new(font: THEME_BOLD_FONT, size: 18, border: true, static: true)
|
@font = CyberarmEngine::Text.new(font: THEME_BOLD_FONT, size: 18, border: true, static: true)
|
||||||
|
@last_mouse_position = CyberarmEngine::Vector.new(window.mouse_x, window.mouse_y)
|
||||||
|
|
||||||
measure_path
|
measure_path
|
||||||
refresh_panel
|
refresh_panel
|
||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
|
super
|
||||||
|
|
||||||
@field.draw
|
@field.draw
|
||||||
|
|
||||||
display_path
|
display_path
|
||||||
@@ -105,15 +108,19 @@ module TAC
|
|||||||
@font.width + 12,
|
@font.width + 12,
|
||||||
@font.height + 12,
|
@font.height + 12,
|
||||||
0xaa_000000,
|
0xaa_000000,
|
||||||
100_000)
|
100_000
|
||||||
|
)
|
||||||
@font.draw
|
|
||||||
|
|
||||||
|
@font.draw
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
super
|
||||||
|
|
||||||
|
current_state.request_repaint if window.mouse_x != @last_mouse_position.x || window.mouse_y != @last_mouse_position.y
|
||||||
|
@last_mouse_position = CyberarmEngine::Vector.new(window.mouse_x, window.mouse_y)
|
||||||
|
|
||||||
@field.update
|
@field.update
|
||||||
|
|
||||||
measure_path
|
measure_path
|
||||||
|
|||||||
Reference in New Issue
Block a user