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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-05-03 19:56:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-05-03 19:56:44 +0400
commit0fdd003d9aa9c61bfd34feaaf86598632cfc3390 (patch)
treefd151c34e96afd7dcdf1d1a1beecc5e8efbcf0ce
parent914d5e5f62acf90e2a3a4e9c65a622a04b574293 (diff)
have timeoffset use (int)floor(timeoffset+0.5f) when converting to an int to avoid problems with nagative values.
-rw-r--r--source/blender/blenkernel/intern/group.c2
-rw-r--r--source/blender/editors/animation/anim_draw.c24
2 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 6a807abc396..2a4d3f6d301 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -333,7 +333,7 @@ void group_handle_recalc_and_update(Scene *scene, Object *parent, Group *group)
/* switch to local time */
cfrao= scene->r.cfra;
- scene->r.cfra -= (int)give_timeoffset(parent);
+ scene->r.cfra -= (int)floor(give_timeoffset(parent) + 0.5f);
/* we need a DAG per group... */
for(go= group->gobject.first; go; go= go->next) {
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 62f421de71c..f5f50e10bcb 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -232,20 +232,22 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
/* Draw dark green line if slow-parenting/time-offset is enabled */
if (flag & DRAWCFRA_SHOW_TIMEOFS) {
Object *ob= (scene->basact) ? (scene->basact->object) : 0;
-
- // XXX ob->ipoflag is depreceated!
- if ((ob) && (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0f)) {
- vec[0]-= give_timeoffset(ob); /* could avoid calling twice */
+ if(ob) {
+ float timeoffset= give_timeoffset(ob);
+ // XXX ob->ipoflag is depreceated!
+ if ((ob->ipoflag & OB_OFFS_OB) && (timeoffset != 0.0f)) {
+ vec[0]-= timeoffset; /* could avoid calling twice */
- UI_ThemeColorShade(TH_CFRAME, -30);
+ UI_ThemeColorShade(TH_CFRAME, -30);
- glBegin(GL_LINE_STRIP);
- /*vec[1]= v2d->cur.ymax;*/ // this is set already. this line is only included
- glVertex2fv(vec);
+ glBegin(GL_LINE_STRIP);
+ /*vec[1]= v2d->cur.ymax;*/ // this is set already. this line is only included
+ glVertex2fv(vec);
- vec[1]= v2d->cur.ymin;
- glVertex2fv(vec);
- glEnd();
+ vec[1]= v2d->cur.ymin;
+ glVertex2fv(vec);
+ glEnd();
+ }
}
}