diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-21 16:59:52 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-21 16:59:52 +0400 |
commit | c8de268e1b636ec9c53d6934d04e8164d0c596c1 (patch) | |
tree | f47b9c6631c336a3a9b009c9b1310efdf0545d6d /source/blender/blenkernel/intern/tracking.c | |
parent | 88a2be1846d3cdca5c0a0f0dc68baad933a9f680 (diff) |
Camera tracing: search area was always centered to marker's position when tracking
Diffstat (limited to 'source/blender/blenkernel/intern/tracking.c')
-rw-r--r-- | source/blender/blenkernel/intern/tracking.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 7461e057df5..373e1e4b9f4 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -1100,13 +1100,13 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki w= (max[0]-min[0])*ibuf->x; h= (max[1]-min[1])*ibuf->y; + /* dimensions should be odd */ w= w|1; h= h|1; - x1= x-(int)(w/2.0f); - y1= y-(int)(h/2.0f); + x1= x-(int)(w * (-min[0] / (max[0] - min[0]))); + y1= y-(int)(h * (-min[1] / (max[1] - min[1]))); - /* dimensions should be odd */ tmpibuf= IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect); IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1-margin, y1-margin, w+margin*2, h+margin*2); |