diff options
-rw-r--r-- | source/blender/editors/include/UI_view2d.h | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 59 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 27 | ||||
-rw-r--r-- | source/blender/editors/space_console/space_console.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_nla/space_nla.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 12 |
15 files changed, 67 insertions, 127 deletions
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index a16c1efd6cf..fee1efcf25b 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -192,16 +192,8 @@ void UI_view2d_grid_draw_numbers_vertical(const struct Scene *scene, void UI_view2d_grid_free(View2DGrid *grid); /* scrollbar drawing */ -View2DScrollers *UI_view2d_scrollers_calc(const struct bContext *C, - struct View2D *v2d, - const struct rcti *mask_custom, - short xunits, - short xclamp, - short yunits, - short yclamp); -void UI_view2d_scrollers_draw(const struct bContext *C, - struct View2D *v2d, - View2DScrollers *scrollers); +View2DScrollers *UI_view2d_scrollers_calc(struct View2D *v2d, const struct rcti *mask_custom); +void UI_view2d_scrollers_draw(struct View2D *v2d, View2DScrollers *scrollers); void UI_view2d_scrollers_free(View2DScrollers *scrollers); /* list view tools */ diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 952778cfc6d..072497dbb74 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1312,7 +1312,6 @@ static void step_to_grid(float *step, const int unit, int *r_power) * * - Currently, will return pointer to View2DGrid struct that needs to * be freed with UI_view2d_grid_free() - * - Is used for scrollbar drawing too (for units drawing) * - Units + clamping args will be checked, to make sure they are valid values that can be used * so it is very possible that we won't return grid at all! * @@ -1753,7 +1752,7 @@ void UI_view2d_grid_draw_numbers_horizontal(const Scene *scene, } float initial_xpos = UI_view2d_view_to_region_x(v2d, grid->startx); - float ypos = (float)rect->ymin + 2 * UI_DPI_FAC; + float ypos = (float)rect->ymin + 4 * UI_DPI_FAC; float initial_value = grid->startx; float value_step = grid->dx; int brevity_level = grid->powerx; @@ -1872,21 +1871,10 @@ struct View2DScrollers { rcti hor, vert; /* exact size of slider backdrop */ int horfull, vertfull; /* set if sliders are full, we don't draw them */ - - /* scales */ - View2DGrid *grid; /* grid for coordinate drawing */ - short xunits, xclamp; /* units and clamping options for x-axis */ - short yunits, yclamp; /* units and clamping options for y-axis */ }; /* Calculate relevant scroller properties */ -View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, - View2D *v2d, - const rcti *mask_custom, - short xunits, - short xclamp, - short yunits, - short yclamp) +View2DScrollers *UI_view2d_scrollers_calc(View2D *v2d, const rcti *mask_custom) { View2DScrollers *scrollers; rcti vert, hor; @@ -2014,30 +2002,11 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, } } - /* grid markings on scrollbars */ - if (scroll & (V2D_SCROLL_SCALE_HORIZONTAL | V2D_SCROLL_SCALE_VERTICAL)) { - /* store clamping */ - scrollers->xclamp = xclamp; - scrollers->xunits = xunits; - scrollers->yclamp = yclamp; - scrollers->yunits = yunits; - - scrollers->grid = UI_view2d_grid_calc(CTX_data_scene(C), - v2d, - xunits, - xclamp, - yunits, - yclamp, - BLI_rcti_size_x(&hor), - BLI_rcti_size_y(&vert)); - } - - /* return scrollers */ return scrollers; } /* Draw scrollbars in the given 2d-region */ -void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *vs) +void UI_view2d_scrollers_draw(View2D *v2d, View2DScrollers *vs) { bTheme *btheme = UI_GetTheme(); rcti vert, hor; @@ -2084,13 +2053,6 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v } UI_draw_widget_scroll(&wcol, &hor, &slider, state); - - { - if (scroll & V2D_SCROLL_SCALE_HORIZONTAL) { - UI_view2d_grid_draw_numbers_horizontal( - CTX_data_scene(C), v2d, vs->grid, &vs->hor, vs->xunits, vs->xclamp == V2D_GRID_CLAMP); - } - } } /* vertical scrollbar */ @@ -2125,17 +2087,6 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v } UI_draw_widget_scroll(&wcol, &vert, &slider, state); - - { - if (scroll & V2D_SCROLL_SCALE_VERTICAL) { - float text_offset = 0.0f; - if (vs->yclamp & V2D_GRID_CLAMP) { - text_offset = 0.5f; - } - UI_view2d_grid_draw_numbers_vertical( - CTX_data_scene(C), v2d, vs->grid, &vs->vert, vs->yunits, text_offset); - } - } } /* Was changed above, so reset. */ @@ -2145,10 +2096,6 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v /* free temporary memory used for drawing scrollers */ void UI_view2d_scrollers_free(View2DScrollers *scrollers) { - /* need to free grid as well... */ - if (scrollers->grid) { - MEM_freeN(scrollers->grid); - } MEM_freeN(scrollers); } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 8880072b82b..ab8d1cf9bf6 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1785,8 +1785,7 @@ static void scroller_activate_init(bContext *C, /* 'zone' depends on where mouse is relative to bubble * - zooming must be allowed on this axis, otherwise, default to pan */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); /* use a union of 'cur' & 'tot' incase the current view is far outside 'tot'. In this cases * moving the scroll bars has far too little effect and the view can get stuck T31476. */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 485a47bfaf7..38684afec39 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2516,9 +2516,8 @@ void ED_region_panels_draw(const bContext *C, ARegion *ar) mask_buf.xmax -= UI_PANEL_CATEGORY_MARGIN_WIDTH; mask = &mask_buf; } - View2DScrollers *scrollers = UI_view2d_scrollers_calc( - C, v2d, mask, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + View2DScrollers *scrollers = UI_view2d_scrollers_calc(v2d, mask); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 5a9c3a66f2b..ce1b53b7bf9 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -202,7 +202,6 @@ static void action_main_region_draw(const bContext *C, ARegion *ar) ar->winx, ar->winy); UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); - UI_view2d_grid_free(grid); ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); @@ -247,11 +246,14 @@ static void action_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); + /* frame numbers */ + UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unit, true); + UI_view2d_grid_free(grid); + /* draw current frame number-indicator on top of scrollers */ if ((saction->flag & SACTION_NODRAWCFRANUM) == 0) { UI_view2d_view_orthoSpecial(ar, v2d, 1); diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index aa58e4cbe54..c411f9d4e04 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1017,7 +1017,6 @@ static void graph_region_draw(const bContext *C, ARegion *ar) View2DScrollers *scrollers; SpaceClip *sc = CTX_wm_space_clip(C); Scene *scene = CTX_data_scene(C); - short unitx, unity; short cfra_flag = 0; if (sc->flag & SC_LOCK_TIMECURSOR) { @@ -1043,13 +1042,19 @@ static void graph_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - unitx = (sc->flag & SC_SHOW_SECONDS) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES; - unity = V2D_UNIT_VALUES; - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); + /* scale indicators */ + short unitx = (sc->flag & SC_SHOW_SECONDS) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES; + short unity = V2D_UNIT_VALUES; + View2DGrid *grid = UI_view2d_grid_calc( + scene, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy); + UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unitx, false); + UI_view2d_grid_draw_numbers_vertical(scene, v2d, grid, &v2d->vert, unity, 0.0); + UI_view2d_grid_free(grid); + /* current frame indicator */ if (sc->flag & SC_SHOW_SECONDS) { cfra_flag |= DRAWCFRA_UNIT_SECONDS; @@ -1083,7 +1088,6 @@ static void dopesheet_region_draw(const bContext *C, ARegion *ar) grid = UI_view2d_grid_calc( scene, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); - UI_view2d_grid_free(grid); /* data... */ clip_draw_dopesheet_main(sc, ar, scene); @@ -1098,11 +1102,14 @@ static void dopesheet_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); + /* frame numbers */ + UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unit, true); + UI_view2d_grid_free(grid); + /* current frame number indicator */ UI_view2d_view_orthoSpecial(ar, v2d, 1); ANIM_draw_cfra_number(C, v2d, cfra_flag); diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 834ede2a927..9632eadeccf 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -231,9 +231,8 @@ static void console_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_GRID_CLAMP); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 1216755151b..9fb07042104 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -441,9 +441,8 @@ static void file_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index c02021591db..1ae69394d0a 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -248,9 +248,6 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) v2d->tot.xmax += 10.0f; } - /* only free grid after drawing data, as we need to use it to determine sampling rate */ - UI_view2d_grid_free(grid); - if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) { uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -324,11 +321,15 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) /* scrollers */ // FIXME: args for scrollers depend on the type of data being shown... - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); + /* scale numbers */ + UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unitx, false); + UI_view2d_grid_draw_numbers_vertical(scene, v2d, grid, &v2d->vert, unity, 0.0f); + UI_view2d_grid_free(grid); + /* draw current frame number-indicator on top of scrollers */ if ((sipo->mode != SIPO_MODE_DRIVERS) && ((sipo->flag & SIPO_NODRAWCFRANUM) == 0)) { UI_view2d_view_orthoSpecial(ar, v2d, 1); @@ -381,9 +382,8 @@ static void graph_channel_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 20bcf19d7f2..67176f9bc49 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -686,14 +686,6 @@ static void image_main_region_draw(const bContext *C, ARegion *ar) WM_gizmomap_draw(ar->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D); draw_image_cache(C, ar); - - /* scrollers? */ -#if 0 - scrollers = UI_view2d_scrollers_calc( - C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); - UI_view2d_scrollers_free(scrollers); -#endif } static void image_main_region_listener( diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 6ed9d80d145..bbe2acfa5d7 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -160,9 +160,8 @@ static void info_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_GRID_CLAMP); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 69fc97e8ea5..6c5a046a0cb 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -205,9 +205,8 @@ static void nla_channel_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } @@ -253,7 +252,6 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar) ar->winx, ar->winy); UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); - UI_view2d_grid_free(grid); ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); @@ -297,11 +295,14 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); + /* frame numbers */ + UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unit, true); + UI_view2d_grid_free(grid); + /* draw current frame number-indicator on top of scrollers */ if ((snla->flag & SNLA_NODRAWCFRANUM) == 0) { UI_view2d_view_orthoSpecial(ar, v2d, 1); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index a694ac2c38b..b8753d0cbfb 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1728,8 +1728,7 @@ void drawnodespace(const bContext *C, ARegion *ar) draw_tree_path(snode); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, 10, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 8e9cd9743b6..a8e3129b5b4 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -96,9 +96,8 @@ static void outliner_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 2fce8c42a24..052917d16d0 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -2088,11 +2088,17 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* scrollers */ unit = (sseq->flag & SEQ_DRAWFRAMES) ? V2D_UNIT_FRAMES : V2D_UNIT_SECONDS; - scrollers = UI_view2d_scrollers_calc( - C, v2d, NULL, unit, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP); - UI_view2d_scrollers_draw(C, v2d, scrollers); + scrollers = UI_view2d_scrollers_calc(v2d, NULL); + UI_view2d_scrollers_draw(v2d, scrollers); UI_view2d_scrollers_free(scrollers); + /* scale numbers */ + View2DGrid *grid = UI_view2d_grid_calc( + scene, v2d, unit, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP, ar->winx, ar->winy); + UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unit, true); + UI_view2d_grid_draw_numbers_vertical(scene, v2d, grid, &v2d->vert, V2D_UNIT_VALUES, 0.5f); + UI_view2d_grid_free(grid); + /* draw current frame number-indicator on top of scrollers */ if ((sseq->flag & SEQ_NO_DRAW_CFRANUM) == 0) { UI_view2d_view_orthoSpecial(ar, v2d, 1); |