diff options
| author | day <day@national.shitposting.agency> | 2026-03-16 16:25:49 +0100 |
|---|---|---|
| committer | day <day@national.shitposting.agency> | 2026-03-16 16:25:49 +0100 |
| commit | 7f85c9fc75bd62ac09ea4457d3b17f85988fca66 (patch) | |
| tree | 15248e42bfafc6bd19e50c9010b701057958ff3a /src/editor/toolview.cpp | |
| parent | 872c39b24ecf4063f785ff3e8b2f940acd8c2d59 (diff) | |
| parent | 991352b0d2767e6bd1a46f554db4ac9d208c13ad (diff) | |
Merge remote-tracking branch 'origin/master' into obj
Diffstat (limited to 'src/editor/toolview.cpp')
| -rw-r--r-- | src/editor/toolview.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/editor/toolview.cpp b/src/editor/toolview.cpp index 25c308d..6bbaa3a 100644 --- a/src/editor/toolview.cpp +++ b/src/editor/toolview.cpp @@ -22,11 +22,11 @@ GUI_EDITOR_TOOLVIEW* gui_editor_toolview_from_item_child( GUI_BASE* child ) { } I32 gui_editor_toolview_visible_h( GUI_EDITOR_TOOLVIEW* view ) { - return std::max( 1, view->h - 4 ); + return max( 1, view->h - 4 ); } I32 gui_editor_toolview_max_scroll( GUI_EDITOR_TOOLVIEW* view ) { - return std::max( 0, view->content_h - gui_editor_toolview_visible_h( view ) ); + return max( 0, view->content_h - gui_editor_toolview_visible_h( view ) ); } void gui_editor_toolview_clamp_scroll( GUI_EDITOR_TOOLVIEW* view ) { @@ -34,7 +34,7 @@ void gui_editor_toolview_clamp_scroll( GUI_EDITOR_TOOLVIEW* view ) { return; I32 max_scroll = gui_editor_toolview_max_scroll( view ); - view->scroll = std::min( std::max( 0, view->scroll ), max_scroll ); + view->scroll = min( max( 0, view->scroll ), max_scroll ); if( view->itemview ) { view->itemview->y = TOOLVIEW_TITLE_OFFSET - view->scroll; } @@ -417,17 +417,17 @@ void gui_editor_toolview_draw_scrollbar( GUI_EDITOR_TOOLVIEW* view, I32 x, I32 y I32 track_x = x + view->w - TOOLVIEW_SCROLLBAR_W - 3; I32 track_y = y + 2; - I32 track_h = std::max( 8, h - 4 ); + I32 track_h = max( 8, h - 4 ); gui_draw_frect( track_x, track_y, TOOLVIEW_SCROLLBAR_W, track_h, ui_clr.bg_alt ); gui_draw_rect( track_x, track_y, TOOLVIEW_SCROLLBAR_W, track_h, ui_clr.border ); I32 visible_h = gui_editor_toolview_visible_h( view ); - I32 thumb_h = std::max( TOOLVIEW_SCROLLBAR_MIN_H, ( track_h * visible_h ) / std::max( 1, view->content_h ) ); - thumb_h = std::min( thumb_h, track_h ); - I32 travel = std::max( 1, track_h - thumb_h ); - I32 thumb_y = track_y + ( travel * view->scroll ) / std::max( 1, max_scroll ); + I32 thumb_h = max( TOOLVIEW_SCROLLBAR_MIN_H, ( track_h * visible_h ) / max( 1, view->content_h ) ); + thumb_h = min( thumb_h, track_h ); + I32 travel = max( 1, track_h - thumb_h ); + I32 thumb_y = track_y + ( travel * view->scroll ) / max( 1, max_scroll ); - gui_draw_frect( track_x + 1, thumb_y + 1, TOOLVIEW_SCROLLBAR_W - 2, std::max( 1, thumb_h - 2 ), ui_clr.txt ); + gui_draw_frect( track_x + 1, thumb_y + 1, TOOLVIEW_SCROLLBAR_W - 2, max( 1, thumb_h - 2 ), ui_clr.txt ); } void gui_editor_toolview_draw_fn( void* ptr ) { @@ -453,7 +453,7 @@ void gui_editor_toolview_draw_fn( void* ptr ) { if( max_scroll > 0 ) clip_w -= TOOLVIEW_SCROLLBAR_W + 2; - gui_draw_push_clip( x + 2, y + 2, std::max( 1, clip_w ), std::max( 1, h - 4 ) ); + gui_draw_push_clip( x + 2, y + 2, max( 1, clip_w ), max( 1, h - 4 ) ); view->itemview->draw_fn( view->itemview ); gui_draw_pop_clip(); gui_editor_toolview_draw_scrollbar( view, x, y, h ); |
