window.c
changeset 2680 7fd99282368c
parent 2675 010fe459fc1d
child 2703 a969970a5245
equal deleted inserted replaced
2679:eec8b1dab852 2680:7fd99282368c
  1180 	}
  1180 	}
  1181 
  1181 
  1182 	w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y);
  1182 	w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y);
  1183 	if (w == NULL) goto stop_capt;
  1183 	if (w == NULL) goto stop_capt;
  1184 
  1184 
       
  1185 	if (_patches.reverse_scroll) {
       
  1186 		dx = -_cursor.delta.x;
       
  1187 		dy = -_cursor.delta.y;
       
  1188 	} else {
       
  1189 		dx = _cursor.delta.x;
       
  1190 		dy = _cursor.delta.y;
       
  1191 	}
       
  1192 
  1185 	if (w->window_class != WC_SMALLMAP) {
  1193 	if (w->window_class != WC_SMALLMAP) {
  1186 		vp = IsPtInWindowViewport(w, _cursor.pos.x, _cursor.pos.y);
  1194 		vp = IsPtInWindowViewport(w, _cursor.pos.x, _cursor.pos.y);
  1187 		if (vp == NULL)
  1195 		if (vp == NULL)
  1188 			goto stop_capt;
  1196 			goto stop_capt;
  1189 
  1197 
  1190 		WP(w,vp_d).scrollpos_x += _cursor.delta.x << vp->zoom;
  1198 		WP(w,vp_d).scrollpos_x += dx << vp->zoom;
  1191 		WP(w,vp_d).scrollpos_y += _cursor.delta.y << vp->zoom;
  1199 		WP(w,vp_d).scrollpos_y += dy << vp->zoom;
       
  1200 
  1192 		_cursor.delta.x = _cursor.delta.y = 0;
  1201 		_cursor.delta.x = _cursor.delta.y = 0;
  1193 		return false;
  1202 		return false;
  1194 	} else {
  1203 	} else {
  1195 		// scroll the smallmap ?
  1204 		// scroll the smallmap ?
  1196 		int hx;
  1205 		int hx;
  1197 		int hy;
  1206 		int hy;
  1198 		int hvx;
  1207 		int hvx;
  1199 		int hvy;
  1208 		int hvy;
  1200 
  1209 
  1201 		_cursor.fix_at = true;
  1210 		_cursor.fix_at = true;
  1202 
       
  1203 		dx = _cursor.delta.x;
       
  1204 		dy = _cursor.delta.y;
       
  1205 
  1211 
  1206 		x = WP(w,smallmap_d).scroll_x;
  1212 		x = WP(w,smallmap_d).scroll_x;
  1207 		y = WP(w,smallmap_d).scroll_y;
  1213 		y = WP(w,smallmap_d).scroll_y;
  1208 
  1214 
  1209 		sub = WP(w,smallmap_d).subscroll + dx;
  1215 		sub = WP(w,smallmap_d).subscroll + dx;