Renaming, I don't like this

This commit is contained in:
krzosa
2025-12-29 09:13:38 +01:00
parent 10fb5d77a1
commit 1ae20a46b2
6 changed files with 81 additions and 35 deletions

View File

@@ -368,13 +368,13 @@ void OnCommand(Event event) {
if (mouse_in_scrollbar) {
ScrollbarSelected = it->id;
View *view = GetView(it->active_view);
Vec2 mouse_vec2 = MouseVec2();
Scroller s = ComputeScrollerRect(it);
double size_y = (double)GetSize(it->scrollbar_rect).y;
double p = mouse_vec2.y - it->scrollbar_rect.min.y;
View *view = GetView(it->active_view);
Vec2 mouse_vec2 = MouseVec2();
Scroller s = ComputeScrollerRect(it);
double size_y = (double)GetSize(it->scrollbar_rect).y;
double p = mouse_vec2.y - it->scrollbar_rect.min.y;
if (mouse_vec2.y < s.rect.min.y || mouse_vec2.y > s.rect.max.y) {
view->scroll.y = (Int)(p / size_y * (double)s.line_count * (double)it->font->line_spacing);
view->scroll.y = (Int)(p / size_y * (double)s.line_count * (double)it->font->line_spacing);
it->mouse_scroller_offset = -(double)GetSize(s.rect).y / 2.0 / size_y;
} else {
it->mouse_scroller_offset = (s.rect.min.y - p) / size_y;