[1.1.5] Textbox cursor

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

[1.1.5] Textbox cursor

#1 Post by Marson »

Not a bug exactly, but the cursor on textboxes and numberboxes can hide when they are aligned with letter stems, like with "p" or "b". It's not an issue when just typing, but it shows up when you use the back arrow. This change will align the cursor between the two characters rather than being offset to the right.

engine/ui/Textbox.lua line 186
engine/ui/Numberbox.lua line 171

Change

self.texcursor.t:toScreenFull(x + self.text_x + (self.cursor-self.scroll) * self.font_mono_w, y + self.cursor_y, self.texcursor.w, self.texcursor.h, self.texcursor.tw, self.texcursor.th)

to

self.texcursor.t:toScreenFull(x + self.text_x + (self.cursor-self.scroll) * self.font_mono_w - (self.texcursor.w / 2), y + self.cursor_y, self.texcursor.w, self.texcursor.h, self.texcursor.tw, self.texcursor.th)

Post Reply