Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d.c
| Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | |||||
| * - for some of these presets, it is expected that the region will have defined some | * - for some of these presets, it is expected that the region will have defined some | ||||
| * additional settings necessary for the customization of the 2D viewport to its requirements | * additional settings necessary for the customization of the 2D viewport to its requirements | ||||
| * - this function should only be called from region init() callbacks, where it is expected that | * - this function should only be called from region init() callbacks, where it is expected that | ||||
| * this is called before UI_view2d_size_update(), as this one checks that the rects are properly initialized. | * this is called before UI_view2d_size_update(), as this one checks that the rects are properly initialized. | ||||
| */ | */ | ||||
| void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) | void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) | ||||
| { | { | ||||
| bool tot_changed = false, do_init; | bool tot_changed = false, do_init; | ||||
| uiStyle *style = UI_GetStyle(); | uiStyle *style = UI_style_get(); | ||||
| do_init = (v2d->flag & V2D_IS_INITIALISED) == 0; | do_init = (v2d->flag & V2D_IS_INITIALISED) == 0; | ||||
| /* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */ | /* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */ | ||||
| switch (type) { | switch (type) { | ||||
| /* 'standard view' - optimum setup for 'standard' view behavior, | /* 'standard view' - optimum setup for 'standard' view behavior, | ||||
| * that should be used new views as basis for their | * that should be used new views as basis for their | ||||
| * own unique View2D settings, which should be used instead of this in most cases... | * own unique View2D settings, which should be used instead of this in most cases... | ||||
| ▲ Show 20 Lines • Show All 1,496 Lines • ▼ Show 20 Lines | if (scroll & V2D_SCROLL_HORIZONTAL) { | ||||
| /* clean rect behind slider, but not with transparent background */ | /* clean rect behind slider, but not with transparent background */ | ||||
| UI_GetThemeColor4ubv(TH_BACK, col); | UI_GetThemeColor4ubv(TH_BACK, col); | ||||
| if (col[3] == 255) { | if (col[3] == 255) { | ||||
| glColor3ub(col[0], col[1], col[2]); | glColor3ub(col[0], col[1], col[2]); | ||||
| glRecti(v2d->hor.xmin, v2d->hor.ymin, v2d->hor.xmax, v2d->hor.ymax); | glRecti(v2d->hor.xmin, v2d->hor.ymin, v2d->hor.xmax, v2d->hor.ymax); | ||||
| } | } | ||||
| uiWidgetScrollDraw(&wcol, &hor, &slider, state); | UI_draw_widget_scroll(&wcol, &hor, &slider, state); | ||||
| /* scale indicators */ | /* scale indicators */ | ||||
| if ((scroll & V2D_SCROLL_SCALE_HORIZONTAL) && (vs->grid)) { | if ((scroll & V2D_SCROLL_SCALE_HORIZONTAL) && (vs->grid)) { | ||||
| View2DGrid *grid = vs->grid; | View2DGrid *grid = vs->grid; | ||||
| float fac, dfac, fac2, val; | float fac, dfac, fac2, val; | ||||
| /* the numbers: convert grid->startx and -dx to scroll coordinates | /* the numbers: convert grid->startx and -dx to scroll coordinates | ||||
| * - fac is x-coordinate to draw to | * - fac is x-coordinate to draw to | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | if (scroll & V2D_SCROLL_VERTICAL) { | ||||
| /* clean rect behind slider, but not with transparent background */ | /* clean rect behind slider, but not with transparent background */ | ||||
| UI_GetThemeColor4ubv(TH_BACK, col); | UI_GetThemeColor4ubv(TH_BACK, col); | ||||
| if (col[3] == 255) { | if (col[3] == 255) { | ||||
| glColor3ub(col[0], col[1], col[2]); | glColor3ub(col[0], col[1], col[2]); | ||||
| glRecti(v2d->vert.xmin, v2d->vert.ymin, v2d->vert.xmax, v2d->vert.ymax); | glRecti(v2d->vert.xmin, v2d->vert.ymin, v2d->vert.xmax, v2d->vert.ymax); | ||||
| } | } | ||||
| uiWidgetScrollDraw(&wcol, &vert, &slider, state); | UI_draw_widget_scroll(&wcol, &vert, &slider, state); | ||||
| /* scale indiators */ | /* scale indiators */ | ||||
| if ((scroll & V2D_SCROLL_SCALE_VERTICAL) && (vs->grid)) { | if ((scroll & V2D_SCROLL_SCALE_VERTICAL) && (vs->grid)) { | ||||
| View2DGrid *grid = vs->grid; | View2DGrid *grid = vs->grid; | ||||
| float fac, dfac, val; | float fac, dfac, val; | ||||
| /* the numbers: convert grid->starty and dy to scroll coordinates | /* the numbers: convert grid->starty and dy to scroll coordinates | ||||
| ▲ Show 20 Lines • Show All 568 Lines • Show Last 20 Lines | |||||