# HG changeset patch # User helios2000@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1276290640 0 # Node ID f45e3e2995e0afb7fe7f98d07b016780337ecf47 # Parent e59ece21ab3eada2a7a44074ce839cadeefbc8e2 * Corrected the h,w calculation for zooming in layercache.cpp. * Fixed the bug, that x,y camera position result in an screen offset. fixes[ticket:462] Note: chewie was right, the ExactModellCoordinate object for camera creating is useless(always 0,0,0). I'm believe that we can remove it from the camera constructor but that would mean an api change. diff -r e59ece21ab3e -r f45e3e2995e0 engine/core/view/camera.cpp --- a/engine/core/view/camera.cpp Fri Jun 04 21:01:34 2010 +0000 +++ b/engine/core/view/camera.cpp Fri Jun 11 21:10:40 2010 +0000 @@ -294,7 +294,7 @@ m_matrix.applyScale(scale, scale, scale); m_matrix.applyRotate(-m_rotation, 0.0, 0.0, 1.0); m_matrix.applyRotate(-m_tilt, 1.0, 0.0, 0.0); - m_matrix.applyTranslate(+m_viewport.w/2, +m_viewport.h/2, 0); + m_matrix.applyTranslate(+m_viewport.x+m_viewport.w/2, +m_viewport.y+m_viewport.h/2, 0); m_inverse_matrix = m_matrix.inverse(); diff -r e59ece21ab3e -r f45e3e2995e0 engine/core/view/layercache.cpp --- a/engine/core/view/layercache.cpp Fri Jun 04 21:01:34 2010 +0000 +++ b/engine/core/view/layercache.cpp Fri Jun 11 21:10:40 2010 +0000 @@ -323,15 +323,15 @@ item.dimensions.x = screen_point.x; item.dimensions.y = screen_point.y; - item.dimensions.w = unsigned(double(item.bbox.w) * zoom + OVERDRAW); - item.dimensions.h = unsigned(double(item.bbox.h) * zoom + OVERDRAW); + item.dimensions.w = item.bbox.w; + item.dimensions.h = item.bbox.h; if (zoom != 1.0) { // NOTE: Due to image alignment, there is additional additions on image dimensions // There's probabaly some better solution for this, but works "good enough" for now. // In case additions are removed, gaps appear between tiles. - item.dimensions.w = unsigned(ceil(double(item.bbox.w) * zoom)) + OVERDRAW; - item.dimensions.h = unsigned(ceil(double(item.bbox.h) * zoom)) + OVERDRAW; + item.dimensions.w = unsigned(double(item.bbox.w) * zoom + OVERDRAW); + item.dimensions.h = unsigned(double(item.bbox.h) * zoom + OVERDRAW); } if(item.dimensions.intersects(screen_viewport))