Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-17 00:36:06 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-17 00:36:06 +0400
commit7fbf5fbe8752c37ce61495e812d76065a6b9bc14 (patch)
tree89df06e752a135ab89a0fd595bf7ed08df44257e /source
parent819d1f417d2fb61719771d20b4999831dd24ca03 (diff)
UI: editor splitting widgets in corners now draw antialiased, also fix 1 pixel
inconsistency between bottom-left and top-right.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/area.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index e6ae8698b14..6a93e39a662 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -169,8 +169,13 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar)
static void area_draw_azone(short x1, short y1, short x2, short y2)
{
- int dx= floor(0.3f*(x2-x1));
- int dy= floor(0.3f*(y2-y1));
+ int dx = x2 - x1;
+ int dy = y2 - y1;
+
+ dx= copysign(ceil(0.3f*fabs(dx)), dx);
+ dy= copysign(ceil(0.3f*fabs(dy)), dy);
+
+ glEnable(GL_LINE_SMOOTH);
glColor4ub(255, 255, 255, 180);
fdrawline(x1, y2, x2, y1);
@@ -185,8 +190,9 @@ static void area_draw_azone(short x1, short y1, short x2, short y2)
fdrawline(x1, y2-dy+1, x2-dx+1, y1);
glColor4ub(0, 0, 0, 150);
fdrawline(x1, y2-2*dy+1, x2-2*dx+1, y1);
-}
+ glDisable(GL_LINE_SMOOTH);
+}
static void region_draw_azone_icon(AZone *az)
{
@@ -550,19 +556,19 @@ static void area_azone_initialize(ScrArea *sa)
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type= AZONE_AREA;
- az->x1= sa->totrct.xmin;
- az->y1= sa->totrct.ymin;
- az->x2= sa->totrct.xmin + AZONESPOT;
- az->y2= sa->totrct.ymin + AZONESPOT;
+ az->x1= sa->totrct.xmin - 1;
+ az->y1= sa->totrct.ymin - 1;
+ az->x2= sa->totrct.xmin + (AZONESPOT-1);
+ az->y2= sa->totrct.ymin + (AZONESPOT-1);
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type= AZONE_AREA;
- az->x1= sa->totrct.xmax+1;
- az->y1= sa->totrct.ymax+1;
- az->x2= sa->totrct.xmax-AZONESPOT;
- az->y2= sa->totrct.ymax-AZONESPOT;
+ az->x1= sa->totrct.xmax + 1;
+ az->y1= sa->totrct.ymax + 1;
+ az->x2= sa->totrct.xmax - (AZONESPOT-1);
+ az->y2= sa->totrct.ymax - (AZONESPOT-1);
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
}