Changeset - r6731:24c1419c7e1c
[Not reviewed]
master
0 1 0
peter1138 - 17 years ago 2007-05-28 17:07:19
peter1138@openttd.org
(svn r9963) -Fix (r9962): 'smooth_scroll' patch setting was ignored (always on) in some places.
1 file changed with 10 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/viewport.cpp
Show inline comments
 
@@ -1397,10 +1397,15 @@ void UpdateViewportPosition(Window *w)
 
		int delta_y = dest_y - y;
 

	
 
		if (delta_x != 0 || delta_y != 0) {
 
			int max_scroll = ScaleByMapSize1D(512);
 
			/* Not at our desired positon yet... */
 
			x += clamp(delta_x / 8, -max_scroll, max_scroll);
 
			y += clamp(delta_y / 8, -max_scroll, max_scroll);
 
			if (_patches.smooth_scroll) {
 
				int max_scroll = ScaleByMapSize1D(512);
 
				/* Not at our desired positon yet... */
 
				x += clamp(delta_x / 8, -max_scroll, max_scroll);
 
				y += clamp(delta_y / 8, -max_scroll, max_scroll);
 
			} else {
 
				x = dest_x;
 
				y = dest_y;
 
			}
 
		}
 

	
 
		/* Convert viewport coordinates to map coordinates
 
@@ -1868,7 +1873,7 @@ bool ScrollWindowTo(int x , int y, Windo
 
	if (WP(w, vp_d).dest_scrollpos_x == pt.x && WP(w, vp_d).dest_scrollpos_y == pt.y)
 
		return false;
 

	
 
	if (!_patches.smooth_scroll || instant) {
 
	if (instant) {
 
		WP(w, vp_d).scrollpos_x = pt.x;
 
		WP(w, vp_d).scrollpos_y = pt.y;
 
	}
0 comments (0 inline, 0 general)