mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
Fixed EditLine not positioning caret correctly when clicked
This commit is contained in:
@@ -59,7 +59,7 @@ module CyberarmEngine
|
|||||||
|
|
||||||
def move_caret_to_mouse(mouse_x)
|
def move_caret_to_mouse(mouse_x)
|
||||||
1.upto(@text.text.length) do |i|
|
1.upto(@text.text.length) do |i|
|
||||||
if mouse_x < @text.x + @text.textobject.text_width(@text.text[0...i])
|
if mouse_x < @text.x - @offset_x + @text.textobject.text_width(@text.text[0...i])
|
||||||
@text_input.caret_pos = @text_input.selection_start = i - 1;
|
@text_input.caret_pos = @text_input.selection_start = i - 1;
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user