mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
Fixed crashes when using EditBox with no content
This commit is contained in:
@@ -62,6 +62,7 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_position(int)
|
def set_position(int)
|
||||||
|
int = 0 if int < 0
|
||||||
@text_input.selection_start = @text_input.caret_pos = int
|
@text_input.selection_start = @text_input.caret_pos = int
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -166,7 +167,9 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def drag_update(sender, x, y, button)
|
def drag_update(sender, x, y, button)
|
||||||
@text_input.caret_pos = caret_position_under_mouse(x, y)
|
int = caret_position_under_mouse(x, y)
|
||||||
|
int = 0 if int < 0
|
||||||
|
@text_input.caret_pos = int
|
||||||
|
|
||||||
:handled
|
:handled
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user