2.5 - Fixing some drawing problems I noticed in ZanQdo's file...
authorJoshua Leung <aligorith@gmail.com>
Tue, 18 Aug 2009 11:48:34 +0000 (11:48 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 18 Aug 2009 11:48:34 +0000 (11:48 +0000)
Alpha for icons wasn't getting set correctly in animation editors anymore. This commit should fix the issues there, though the scrollbars still have a few minor issues still too.

Also, NLA strips with repeats now have the repeat indicators drawn only 80% or so of the height, making it easier to distinguish between strips with repeats and bunches of strips.

source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_nla/nla_draw.c

index 25e3c112389a3fbde9ce6f1c4dbe0b5eddac01fa..acf7467713b83b259f4b8c2adb39f7c329e75f45 100644 (file)
@@ -1902,6 +1902,10 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float
                selected= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
        else
                selected= 0;
+               
+       /* set blending again, as may not be set in previous step */
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+       glEnable(GL_BLEND);
        
        /* step 1) draw backdrop ...........................................  */
        if (acf->draw_backdrop)
index c2d8d7b13455d21fa2ecf16daf61cfe5c238ffa8..f3aa0fac42bdaf328522e4775b2e178f7c3b8f38 100644 (file)
@@ -926,6 +926,10 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARe
                
                y= (float)ACHANNEL_FIRST;
                
+               /* set blending again, as may not be set in previous step */
+               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+               glEnable(GL_BLEND);
+               
                for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
                        const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
                        const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
@@ -944,6 +948,8 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARe
                
                uiEndBlock(C, block);
                uiDrawBlock(C, block);
+               
+               glDisable(GL_BLEND);
        }
        
        /* free tempolary channels */
index 3a0e150050b8d7dec20c06862f76e8b0e566c746..f30954292b471c8f3c9bb64b25415964dcbaf472 100644 (file)
@@ -411,7 +411,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStr
                        
                        /* don't draw if line would end up on or after the end of the strip */
                        if (repeatPos < strip->end)
-                               fdrawline(repeatPos, yminc, repeatPos, ymaxc);
+                               fdrawline(repeatPos, yminc+4, repeatPos, ymaxc-4);
                }
        }
        /* or if meta-strip, draw lines delimiting extents of sub-strips (in same color as outline, if more than 1 exists) */
@@ -875,6 +875,10 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegi
                
                y= (float)(-NLACHANNEL_HEIGHT);
                
+               /* set blending again, as may not be set in previous step */
+               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+               glEnable(GL_BLEND);
+               
                /* loop through channels, and set up drawing depending on their type  */        
                for (ale= anim_data.first; ale; ale= ale->next) {
                        const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF);
@@ -894,6 +898,8 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegi
                
                uiEndBlock(C, block);
                uiDrawBlock(C, block);
+               
+               glDisable(GL_BLEND);
        }
        
        /* free tempolary channels */