forked from bartvdbraak/blender
Cleanup: Duplicated function
wmOrtho2_region_pixelspace and wmOrtho2_region_ui were doing exact same thing since rBSa86482f81cf3.
This commit is contained in:
parent
94349ab308
commit
49ba9740b8
@ -1383,7 +1383,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
wmOrtho2_region_ui(ar);
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
|
||||
/* back */
|
||||
if (block->flag & UI_BLOCK_RADIAL)
|
||||
|
@ -242,7 +242,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
|
||||
if (multisample_enabled)
|
||||
glDisable(GL_MULTISAMPLE);
|
||||
|
||||
wmOrtho2_region_ui(ar);
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
|
||||
/* draw background */
|
||||
ui_draw_tooltip_background(UI_style_get(), NULL, &bbox);
|
||||
@ -1085,7 +1085,7 @@ static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
|
||||
uiSearchboxData *data = ar->regiondata;
|
||||
|
||||
/* pixel space */
|
||||
wmOrtho2_region_ui(ar);
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
|
||||
if (data->noback == false)
|
||||
ui_draw_search_back(NULL, NULL, &data->bbox); /* style not used yet */
|
||||
|
@ -2394,7 +2394,7 @@ void UI_view2d_text_cache_draw(ARegion *ar)
|
||||
/* investigate using BLF_ascender() */
|
||||
const float default_height = g_v2d_strings ? BLF_height_default("28", 3) : 0.0f;
|
||||
|
||||
wmOrtho2_region_ui(ar);
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
|
||||
for (v2s = g_v2d_strings; v2s; v2s = v2s->next) {
|
||||
int xofs = 0, yofs;
|
||||
|
@ -502,7 +502,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
|
||||
/* note; this sets state, so we can use wmOrtho and friends */
|
||||
wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, scissor_pad);
|
||||
|
||||
wmOrtho2_region_ui(ar);
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
|
||||
UI_SetTheme(sa ? sa->spacetype : 0, at->regionid);
|
||||
|
||||
|
@ -893,7 +893,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, bool depth_write, flo
|
||||
glPushMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
wmOrtho2_region_ui(ar);
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
glLoadIdentity();
|
||||
|
||||
if (depth_write) {
|
||||
|
@ -409,7 +409,6 @@ void wmOrtho (float x1, float x2, float y1, float y2, float n, float f);
|
||||
void wmOrtho2 (float x1, float x2, float y1, float y2);
|
||||
/* use for conventions (avoid hard-coded offsets all over) */
|
||||
void wmOrtho2_region_pixelspace(const struct ARegion *ar);
|
||||
void wmOrtho2_region_ui(const struct ARegion *ar);
|
||||
void wmOrtho2_pixelspace(const float x, const float y);
|
||||
|
||||
/* utilities */
|
||||
|
@ -367,7 +367,7 @@ static void wmOrtho2_offset(const float x, const float y, const float ofs)
|
||||
/**
|
||||
* default pixel alignment.
|
||||
*/
|
||||
void wmOrtho2_region_pixelspace(const struct ARegion *ar)
|
||||
void wmOrtho2_region_pixelspace(const ARegion *ar)
|
||||
{
|
||||
wmOrtho2_offset(ar->winx, ar->winy, -0.01f);
|
||||
}
|
||||
@ -377,17 +377,6 @@ void wmOrtho2_pixelspace(const float x, const float y)
|
||||
wmOrtho2_offset(x, y, -GLA_PIXEL_OFS);
|
||||
}
|
||||
|
||||
/**
|
||||
* use for drawing uiBlock, any UI elements and text.
|
||||
* \note prevents blurry text with multi-sample (FSAA), see T41749
|
||||
*/
|
||||
void wmOrtho2_region_ui(const ARegion *ar)
|
||||
{
|
||||
/* note, intentionally no '+ 1',
|
||||
* as with wmOrtho2_region_pixelspace */
|
||||
wmOrtho2_offset(ar->winx, ar->winy, -0.01f);
|
||||
}
|
||||
|
||||
/* *************************** Framebuffer color depth, for selection codes ********************** */
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
Loading…
Reference in New Issue
Block a user