[Bf-blender-cvs] [a48a66f] master: A few urgent glLineWidth fixes for anim editors
Joshua Leung
noreply at git.blender.org
Mon Jan 25 11:54:59 CET 2016
Commit: a48a66fb19e72531b713840909d93dde8fa3caa0
Author: Joshua Leung
Date: Mon Jan 25 23:45:45 2016 +1300
Branches: master
https://developer.blender.org/rBa48a66fb19e72531b713840909d93dde8fa3caa0
A few urgent glLineWidth fixes for anim editors
This fixes some of the issues noted by venomgfx that were caused by
Se25ba162c0b62b19cf367f0f29e29d0c0960978d
Specifically, this commit fixes:
* Timeline: Keyframe lines
* Graph Editor: Curves and Handles
===================================================================
M source/blender/editors/space_graph/graph_draw.c
M source/blender/editors/space_time/space_time.c
===================================================================
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index c441bdd..3ac9020 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -1008,6 +1008,9 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
if (fcu->flag & FCURVE_ACTIVE) {
glLineWidth(2.0);
}
+ else {
+ glLineWidth(1.0);
+ }
/* anti-aliased lines for less jagged appearance */
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) glEnable(GL_LINE_SMOOTH);
@@ -1058,11 +1061,15 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
short mapping_flag = ANIM_get_normalization_flags(ac);
float offset;
float unit_scale = ANIM_unit_mapping_get_factor(ac->scene, ale->id, fcu, mapping_flag, &offset);
-
+
+ /* apply unit-scaling to all values via OpenGL */
glPushMatrix();
glScalef(1.0f, unit_scale, 1.0f);
glTranslatef(0.0f, offset, 0.0f);
-
+
+ /* set this once and for all - all handles and handle-verts should use the same thickness */
+ glLineWidth(1.0);
+
if (fcu->bezt) {
bool do_handles = draw_fcurve_handles_check(sipo, fcu);
@@ -1079,7 +1086,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
/* samples: only draw two indicators at either end as indicators */
draw_fcurve_samples(sipo, ar, fcu);
}
-
+
glPopMatrix();
}
}
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 4c64c52..fde955c 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -352,6 +352,9 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar)
View2D *v2d = &ar->v2d;
bool onlysel = ((scene->flag & SCE_KEYS_NO_SELONLY) == 0);
+ /* set this for all keyframe lines once and for all */
+ glLineWidth(1.0);
+
/* draw grease pencil keyframes (if available) */
UI_ThemeColor(TH_TIME_GP_KEYFRAME);
if (scene->gpd) {
More information about the Bf-blender-cvs
mailing list