diff options
author | Jiri Hnidek <jiri.hnidek@tul.cz> | 2005-05-12 01:50:19 +0400 |
---|---|---|
committer | Jiri Hnidek <jiri.hnidek@tul.cz> | 2005-05-12 01:50:19 +0400 |
commit | 516e21459c2735ef778f31ebd853f70893d33b2c (patch) | |
tree | c0af485a9c97534c5bf27b53ff08fe03ff576d72 /source/blender/src/drawtime.c | |
parent | 884c94500bce8545aa988a85136e49948b245d05 (diff) |
- it was imposible to select one of two markers laying at the same frame ... this
problem is solved now. Drawing of markers is little bit hackish, because it is
neccessary to draw unselected markers at the first time (unselected marker can't
hide selected marker ... visual information about selection would be lost)
Diffstat (limited to 'source/blender/src/drawtime.c')
-rw-r--r-- | source/blender/src/drawtime.c | 67 |
1 files changed, 40 insertions, 27 deletions
diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c index a624f46b5c8..d505e888b2b 100644 --- a/source/blender/src/drawtime.c +++ b/source/blender/src/drawtime.c @@ -117,43 +117,56 @@ static void draw_cfra_time(SpaceTime *stime) } -static void draw_markers_time(SpaceTime *stime) +static void draw_marker(TimeMarker *marker) { - TimeMarker *marker; float xpos, col[3]; float xspace, yspace, xpixels, ypixels; - for(marker= G.scene->markers.first; marker; marker= marker->next) { - xpos = marker->frame; - /* no time correction for framelen! space is drawn with old values */ - - xspace= G.v2d->cur.xmax - G.v2d->cur.xmin; - yspace= G.v2d->cur.ymax - G.v2d->cur.ymin; - xpixels= G.v2d->mask.xmax-G.v2d->mask.xmin; - ypixels= G.v2d->mask.ymax-G.v2d->mask.ymin; + xpos = marker->frame; + /* no time correction for framelen! space is drawn with old values */ + + xspace= G.v2d->cur.xmax - G.v2d->cur.xmin; + yspace= G.v2d->cur.ymax - G.v2d->cur.ymin; + xpixels= G.v2d->mask.xmax-G.v2d->mask.xmin; + ypixels= G.v2d->mask.ymax-G.v2d->mask.ymin; - /* 5 px to offset icon to align properly, space / pixels corrects for zoom */ - glRasterPos2f(xpos-(5.0*(xspace/xpixels)), 12.0*yspace/ypixels); + /* 5 px to offset icon to align properly, space / pixels corrects for zoom */ + glRasterPos2f(xpos-(5.0*(xspace/xpixels)), 12.0*yspace/ypixels); - BIF_GetThemeColor3fv(TH_BACK, col); + BIF_GetThemeColor3fv(TH_BACK, col); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - if(marker->flag & SELECT) - BIF_draw_icon_blended(ICON_MARKER_HLT, (int)col, 0); - else - BIF_draw_icon_blended(ICON_MARKER, (int)col, 0); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + if(marker->flag & SELECT) + BIF_draw_icon_blended(ICON_MARKER_HLT, (int)col, 0); + else + BIF_draw_icon_blended(ICON_MARKER, (int)col, 0); + + glBlendFunc(GL_ONE, GL_ZERO); + glDisable(GL_BLEND); + + /* and the marker name too, shifted slightly to the top-right */ + BIF_ThemeColor(TH_TEXT); + glRasterPos2f(xpos+(4.0*(xspace/xpixels)), 17.0*yspace/ypixels); - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); + BMF_DrawString(G.font, marker->name); +} - /* and the marker name too, shifted slightly to the top-right */ - BIF_ThemeColor(TH_TEXT); - glRasterPos2f(xpos+(4.0*(xspace/xpixels)), 17.0*yspace/ypixels); - - BMF_DrawString(G.font, marker->name); +static void draw_markers_time(SpaceTime *stime) +{ + TimeMarker *marker; + /* unselected markers are drawn at the first time */ + for(marker= G.scene->markers.first; marker; marker= marker->next) { + if(!(marker->flag & SELECT)) draw_marker(marker); + } + + /* selected markers are drawn later ... selected markers have to cover unselected + * markers laying at the same position as selected markers + * (jiri: it is hack, it could be solved better) */ + for(marker= G.scene->markers.first; marker; marker= marker->next) { + if(marker->flag & SELECT) draw_marker(marker); } } |