Changeset - r23027:b4e0d40ee09e
[Not reviewed]
master
0 1 0
Charles Pigott - 6 years ago 2018-10-17 19:51:47
charlespigott@googlemail.com
Codechange: Turn a define into a constant
1 file changed with 5 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -2751,18 +2751,17 @@ static void HandleAutoscroll()
 
	y -= vp->top;
 

	
 
	/* here allows scrolling in both x and y axis */
 
#define scrollspeed 3
 
	static const int SCROLLSPEED = 3;
 
	if (x - 15 < 0) {
 
		w->viewport->dest_scrollpos_x += ScaleByZoom((x - 15) * scrollspeed, vp->zoom);
 
		w->viewport->dest_scrollpos_x += ScaleByZoom((x - 15) * SCROLLSPEED, vp->zoom);
 
	} else if (15 - (vp->width - x) > 0) {
 
		w->viewport->dest_scrollpos_x += ScaleByZoom((15 - (vp->width - x)) * scrollspeed, vp->zoom);
 
		w->viewport->dest_scrollpos_x += ScaleByZoom((15 - (vp->width - x)) * SCROLLSPEED, vp->zoom);
 
	}
 
	if (y - 15 < 0) {
 
		w->viewport->dest_scrollpos_y += ScaleByZoom((y - 15) * scrollspeed, vp->zoom);
 
		w->viewport->dest_scrollpos_y += ScaleByZoom((y - 15) * SCROLLSPEED, vp->zoom);
 
	} else if (15 - (vp->height - y) > 0) {
 
		w->viewport->dest_scrollpos_y += ScaleByZoom((15 - (vp->height - y)) * scrollspeed, vp->zoom);
 
		w->viewport->dest_scrollpos_y += ScaleByZoom((15 - (vp->height - y)) * SCROLLSPEED, vp->zoom);
 
	}
 
#undef scrollspeed
 
}
 

	
 
enum MouseClick {
0 comments (0 inline, 0 general)