Fix LineEdit text incorrectly trimmed due to rounding errors.

This commit is contained in:
bruvzg 2022-07-06 11:57:06 +03:00
parent d26442e709
commit 3316454379
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
3 changed files with 30 additions and 31 deletions

View file

@ -102,7 +102,7 @@ private:
bool caret_mid_grapheme_enabled = true;
int caret_column = 0;
int scroll_offset = 0;
float scroll_offset = 0.0;
int max_length = 0; // 0 for no maximum.
String language;
@ -141,8 +141,7 @@ private:
struct TextOperation {
int caret_column = 0;
int scroll_offset = 0;
int cached_width = 0;
float scroll_offset = 0.0;
String text;
};
List<TextOperation> undo_stack;
@ -180,11 +179,11 @@ private:
void shift_selection_check_post(bool);
void selection_fill_at_caret();
void set_scroll_offset(int p_pos);
int get_scroll_offset() const;
void set_scroll_offset(float p_pos);
float get_scroll_offset() const;
void set_caret_at_pixel_pos(int p_x);
Vector2i get_caret_pixel_pos();
Vector2 get_caret_pixel_pos();
void _reset_caret_blink_timer();
void _toggle_draw_caret();