UI fixes:
- on setting lower DPI, the regions that were scrolled down would start moving down 1 pixel on every draw. Caused by rounding error. (int + 0.1 vs int -0.1) (Ancient bug) - circles used in outliner - to denote selection/active - now draw bigger, and better centered. (2.66 fix only)
This commit is contained in:
@@ -852,10 +852,11 @@ void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, int resize
|
||||
|
||||
/* hrumf! */
|
||||
/* XXX: there are work arounds for this in the panel and file browse code. */
|
||||
/* round to int, because this is called with width + V2D_SCROLL_WIDTH */
|
||||
if (scroll & V2D_SCROLL_HORIZONTAL)
|
||||
width -= V2D_SCROLL_WIDTH;
|
||||
width -= (int)V2D_SCROLL_WIDTH;
|
||||
if (scroll & V2D_SCROLL_VERTICAL)
|
||||
height -= V2D_SCROLL_HEIGHT;
|
||||
height -= (int)V2D_SCROLL_HEIGHT;
|
||||
|
||||
if (ELEM(0, width, height)) {
|
||||
if (G.debug & G_DEBUG)
|
||||
|
||||
@@ -1703,7 +1703,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
|
||||
v2d->keepofs &= ~(V2D_LOCKOFS_Y | V2D_KEEPOFS_X);
|
||||
v2d->scroll |= V2D_SCROLL_HORIZONTAL_HIDE;
|
||||
v2d->scroll &= ~V2D_SCROLL_VERTICAL_HIDE;
|
||||
|
||||
|
||||
/* ensure tot is set correctly, to keep views on bottons, with sliders */
|
||||
y = min_ii(y, v2d->cur.ymin);
|
||||
y = -y;
|
||||
@@ -1724,8 +1724,8 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
|
||||
y = -y;
|
||||
}
|
||||
|
||||
/* +V2D_SCROLL_HEIGHT is workaround to set the actual height */
|
||||
UI_view2d_totRect_set(v2d, x + V2D_SCROLL_WIDTH, y + V2D_SCROLL_HEIGHT);
|
||||
/* +V2D_SCROLL_HEIGHT is workaround to set the actual height (needs to be int) */
|
||||
UI_view2d_totRect_set(v2d, x + (int)V2D_SCROLL_WIDTH, y + (int)V2D_SCROLL_HEIGHT);
|
||||
|
||||
/* set the view */
|
||||
UI_view2d_view_ortho(v2d);
|
||||
|
||||
@@ -1227,10 +1227,10 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
|
||||
float ufac = UI_UNIT_X / 20.0f;
|
||||
|
||||
uiSetRoundBox(UI_CNR_ALL);
|
||||
glColor4ub(255, 255, 255, 100);
|
||||
uiRoundBox((float) *offsx - 1.5f * ufac,
|
||||
(float)ys + 2.0f * ufac,
|
||||
(float)*offsx + UI_UNIT_X - 3.0f * ufac,
|
||||
glColor4ub(255, 255, 255, 128);
|
||||
uiRoundBox((float) *offsx - 1.0f * ufac,
|
||||
(float)ys + 1.0f * ufac,
|
||||
(float)*offsx + UI_UNIT_X - 1.0f * ufac,
|
||||
(float)ys + UI_UNIT_Y - 1.0f * ufac,
|
||||
(float)UI_UNIT_Y / 2.0f - 2.0f * ufac);
|
||||
glEnable(GL_BLEND); /* roundbox disables */
|
||||
@@ -1278,6 +1278,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
|
||||
|
||||
if (*starty + 2 * UI_UNIT_Y >= ar->v2d.cur.ymin && *starty <= ar->v2d.cur.ymax) {
|
||||
int xmax = ar->v2d.cur.xmax;
|
||||
unsigned char alpha = 128;
|
||||
|
||||
/* icons can be ui buts, we don't want it to overlap with restrict */
|
||||
if ((soops->flag & SO_HIDE_RESTRICTCOLS) == 0)
|
||||
@@ -1294,16 +1295,17 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
|
||||
{
|
||||
char col[4];
|
||||
UI_GetThemeColorType4ubv(TH_MATCH, SPACE_OUTLINER, col);
|
||||
col[3] = 100;
|
||||
col[3] = alpha;
|
||||
glColor4ubv((GLubyte *)col);
|
||||
glRecti(startx, *starty + 1, ar->v2d.cur.xmax, *starty + UI_UNIT_Y - 1);
|
||||
}
|
||||
|
||||
/* colors for active/selected data */
|
||||
if (tselem->type == 0) {
|
||||
|
||||
if (te->idcode == ID_SCE) {
|
||||
if (tselem->id == (ID *)scene) {
|
||||
glColor4ub(255, 255, 255, 100);
|
||||
glColor4ub(255, 255, 255, alpha);
|
||||
active = 2;
|
||||
}
|
||||
}
|
||||
@@ -1312,7 +1314,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
|
||||
if (group_select_flag(gr)) {
|
||||
char col[4];
|
||||
UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
|
||||
col[3] = 100;
|
||||
col[3] = alpha;
|
||||
glColor4ubv((GLubyte *)col);
|
||||
|
||||
active = 2;
|
||||
@@ -1330,14 +1332,14 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
|
||||
if (ob == OBACT) {
|
||||
if (ob->flag & SELECT) {
|
||||
UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col);
|
||||
col[3] = 100;
|
||||
col[3] = alpha;
|
||||
}
|
||||
|
||||
active = 1; /* means it draws white text */
|
||||
}
|
||||
else if (ob->flag & SELECT) {
|
||||
UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
|
||||
col[3] = 100;
|
||||
col[3] = alpha;
|
||||
}
|
||||
|
||||
glColor4ubv((GLubyte *)col);
|
||||
@@ -1345,27 +1347,27 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
|
||||
|
||||
}
|
||||
else if (scene->obedit && scene->obedit->data == tselem->id) {
|
||||
glColor4ub(255, 255, 255, 100);
|
||||
glColor4ub(255, 255, 255, alpha);
|
||||
active = 2;
|
||||
}
|
||||
else {
|
||||
if (tree_element_active(C, scene, soops, te, 0)) {
|
||||
glColor4ub(220, 220, 255, 100);
|
||||
glColor4ub(220, 220, 255, alpha);
|
||||
active = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (tree_element_type_active(NULL, scene, soops, te, tselem, 0) ) active = 2;
|
||||
glColor4ub(220, 220, 255, 100);
|
||||
glColor4ub(220, 220, 255, alpha);
|
||||
}
|
||||
|
||||
/* active circle */
|
||||
if (active) {
|
||||
uiSetRoundBox(UI_CNR_ALL);
|
||||
uiRoundBox((float)startx + UI_UNIT_X - 1.5f * ufac,
|
||||
(float)*starty + 2.0f * ufac,
|
||||
(float)startx + 2.0f * UI_UNIT_X - 3.0f * ufac,
|
||||
uiRoundBox((float)startx + UI_UNIT_X - 1.0f * ufac,
|
||||
(float)*starty + 1.0f * ufac,
|
||||
(float)startx + 2.0f * UI_UNIT_X - 1.0f * ufac,
|
||||
(float)*starty + UI_UNIT_Y - 1.0f * ufac,
|
||||
UI_UNIT_Y / 2.0f - 2.0f * ufac);
|
||||
glEnable(GL_BLEND); /* roundbox disables it */
|
||||
|
||||
Reference in New Issue
Block a user