src/viewport.cpp
changeset 7923 91982bd3c549
parent 7922 a7e266f966d9
child 7928 63e18de69e50
equal deleted inserted replaced
7922:a7e266f966d9 7923:91982bd3c549
  2520 	HighLightStyle b;
  2520 	HighLightStyle b;
  2521 	uint w, h;
  2521 	uint w, h;
  2522 
  2522 
  2523 	int dx = thd->selstart.x - (thd->selend.x & ~0xF);
  2523 	int dx = thd->selstart.x - (thd->selend.x & ~0xF);
  2524 	int dy = thd->selstart.y - (thd->selend.y & ~0xF);
  2524 	int dy = thd->selstart.y - (thd->selend.y & ~0xF);
  2525 	w = myabs(dx) + 16;
  2525 	w = abs(dx) + 16;
  2526 	h = myabs(dy) + 16;
  2526 	h = abs(dy) + 16;
  2527 
  2527 
  2528 	if (TileVirtXY(thd->selstart.x, thd->selstart.y) == TileVirtXY(x, y)) { // check if we're only within one tile
  2528 	if (TileVirtXY(thd->selstart.x, thd->selstart.y) == TileVirtXY(x, y)) { // check if we're only within one tile
  2529 		if (method == VPM_RAILDIRS) {
  2529 		if (method == VPM_RAILDIRS) {
  2530 			b = GetAutorailHT(x, y);
  2530 			b = GetAutorailHT(x, y);
  2531 		} else { // rect for autosignals on one tile
  2531 		} else { // rect for autosignals on one tile
  2676 	sx = _thd.selstart.x;
  2676 	sx = _thd.selstart.x;
  2677 	sy = _thd.selstart.y;
  2677 	sy = _thd.selstart.y;
  2678 
  2678 
  2679 	switch (method) {
  2679 	switch (method) {
  2680 		case VPM_X_OR_Y: /* drag in X or Y direction */
  2680 		case VPM_X_OR_Y: /* drag in X or Y direction */
  2681 			if (myabs(sy - y) < myabs(sx - x)) {
  2681 			if (abs(sy - y) < abs(sx - x)) {
  2682 				y = sy;
  2682 				y = sy;
  2683 				style = HT_DIR_X;
  2683 				style = HT_DIR_X;
  2684 			} else {
  2684 			} else {
  2685 				x = sx;
  2685 				x = sx;
  2686 				style = HT_DIR_Y;
  2686 				style = HT_DIR_Y;