mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
This commit is contained in:
parent
beda478821
commit
9624b54703
Notes:
sideshowbarker
2024-07-19 15:37:54 +09:00
Author: https://github.com/awesomekling
Commit: 9624b54703
48 changed files with 234 additions and 250 deletions
|
@ -35,13 +35,13 @@ void GTextBox::paint_event(GPaintEvent&)
|
|||
Rect inner_rect = rect();
|
||||
inner_rect.shrink(6, 6);
|
||||
|
||||
size_t max_chars_to_paint = inner_rect.width() / font().glyph_width();
|
||||
ssize_t max_chars_to_paint = inner_rect.width() / font().glyph_width();
|
||||
|
||||
int first_visible_char = max((int)m_cursor_position - (int)max_chars_to_paint, 0);
|
||||
size_t chars_to_paint = min(m_text.length() - first_visible_char, max_chars_to_paint);
|
||||
ssize_t chars_to_paint = min(m_text.length() - first_visible_char, max_chars_to_paint);
|
||||
|
||||
int y = inner_rect.center().y() - font().glyph_height() / 2;
|
||||
for (size_t i = 0; i < chars_to_paint; ++i) {
|
||||
for (ssize_t i = 0; i < chars_to_paint; ++i) {
|
||||
char ch = m_text[first_visible_char + i];
|
||||
if (ch == ' ')
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue