Refactor: BLF Extract Function BLF_str_offset_to_cursor #120622
|
@ -1105,10 +1105,10 @@ int blf_str_offset_to_cursor(
|
|||
else if (prev.xmax && next.xmax) {
|
||||
/* Middle of the string, so in between. */
|
||||
if (next.xmin >= prev.xmax) {
|
||||
return int((prev.xmax + next.xmin - cursor_width) / 2.0f);
|
||||
return int((float(prev.xmax + next.xmin) - cursor_width) / 2.0f);
|
||||
}
|
||||
/* Possible with RTL. */
|
||||
return int((next.xmax + prev.xmin - cursor_width) / 2.0f);
|
||||
return int((float(next.xmax + prev.xmin) - cursor_width) / 2.0f);
|
||||
}
|
||||
else if (!str_offset) {
|
||||
/* Before first space character. */
|
||||
|
|
|
@ -2019,8 +2019,8 @@ static void widget_draw_text(const uiFontStyle *fstyle,
|
|||
/* IME candidate window uses cursor position. */
|
||||
if (!ime_reposition_window) {
|
||||
ime_reposition_window = true;
|
||||
ime_win_x = but_cursor_shape.xmax + 5;
|
||||
ime_win_y = but_cursor_shape.ymin + 3;
|
||||
ime_win_x = rect->xmin + t + 5;
|
||||
ime_win_y = rect->ymin + 3;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue