diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-08 16:30:09 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-08 16:30:09 +0400 |
commit | 5f5ddb00146884d28414811bc92311af56d55904 (patch) | |
tree | 6cd08b398d2f9cc721aff27ab4c69667cbcd86b0 /source/blender/editors/space_nla/nla_draw.c | |
parent | 665938191df7e831ba22f101b00ab9b99bdde654 (diff) |
NLA SoC: Little optimisation + Drawing bugfix
* Text labels on NLA-Strips should now draw properly for most short-strips now. Previously, the padding on the text was a bit too extreme, so for very short strips (less than 4 frames or so), the text was often pushed down into the bottom-right corner of view.
* Optimised the keyframe-highlighting code for buttons a bit. Replaced the custom linear-search with the binary-search used when inserting keyframes (and for the 3d-view keyframe-indicator). There should be some theoretical improvements due to this at least...
Diffstat (limited to 'source/blender/editors/space_nla/nla_draw.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 7b9f2faf08a..bbb666d01cc 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -291,6 +291,9 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); + /* draw influence 'curve' */ + // TODO: + /* draw strip outline * - color used here is to indicate active vs non-active */ @@ -378,11 +381,9 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ default: - if (strip->act) - sprintf(str, "%d | Act: %s | %.2f %s %.2f", - index, strip->act->id.name+2, strip->start, dir, strip->end); - else - sprintf(str, "%d | Act: <NONE>", index); // xxx... need a better format? + sprintf(str, "%d | Act: %s | %.2f %s %.2f", + index, ((strip->act)?strip->act->id.name+2:"<NONE>"), + strip->start, dir, strip->end); break; } @@ -396,9 +397,9 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View * - padding of 2 'units' on either side */ // TODO: make this centered? - rect.xmin= strip->start + 2; + rect.xmin= strip->start + 0.5f; rect.ymin= yminc; - rect.xmax= strip->end - 2; + rect.xmax= strip->end - 0.5f; rect.ymax= ymaxc; /* add this string to the cache of texts to draw*/ |