Align the space origin on a whole pixel: fixes dancing Sa-Matra on slow flybys (part of bug #685); this does not resolve the object positioning jitter completely

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2826 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2007-07-31 09:39:27 +00:00
parent ca2f82e40f
commit 2dcea171b5
+6 -4
View File
@@ -324,10 +324,12 @@ CalcView (POINT *pNewScrollPt, SIZE next_reduction,
&& zoom_out - next_reduction > ZOOM_JUMP)
next_reduction = zoom_out - ZOOM_JUMP;
SpaceOrg.x = (int)(LOG_SPACE_WIDTH >> 1)
- (LOG_SPACE_WIDTH * next_reduction / (MAX_ZOOM_OUT << 2));
SpaceOrg.y = (int)(LOG_SPACE_HEIGHT >> 1)
- (LOG_SPACE_HEIGHT * next_reduction / (MAX_ZOOM_OUT << 2));
// Always align the origin on a whole pixel to reduce the
// amount of object positioning jitter
SpaceOrg.x = DISPLAY_ALIGN((int)(LOG_SPACE_WIDTH >> 1) -
(LOG_SPACE_WIDTH * next_reduction / (MAX_ZOOM_OUT << 2)));
SpaceOrg.y = DISPLAY_ALIGN((int)(LOG_SPACE_HEIGHT >> 1) -
(LOG_SPACE_HEIGHT * next_reduction / (MAX_ZOOM_OUT << 2)));
}
zoom_out = next_reduction;
view_state = VIEW_CHANGE;