use atan2() in Rotate_brush_0_5(). Remove warnings in MSVC++
acos() was replaced by atan2() in Rotate_brush_1_5() in commit 2d8c061e3220a592dd894ccde4ebbd80c6c16897 it was forgotten in Rotate_brush_0_5() ;)
This commit is contained in:
		
							parent
							
								
									f9616f570a
								
							
						
					
					
						commit
						bae93cba7a
					
				@ -950,7 +950,7 @@ void Rotate_brush_1_5(void)
 | 
			
		||||
  short old_x;
 | 
			
		||||
  short old_y;
 | 
			
		||||
  short prev_state;
 | 
			
		||||
  float angle;
 | 
			
		||||
  double angle;
 | 
			
		||||
  int dx,dy;
 | 
			
		||||
  short cursor_x,cursor_y;
 | 
			
		||||
 | 
			
		||||
@ -973,7 +973,7 @@ void Rotate_brush_1_5(void)
 | 
			
		||||
    {
 | 
			
		||||
      dx=cursor_x-Brush_rotation_center_X;
 | 
			
		||||
      dy=cursor_y-Brush_rotation_center_Y;
 | 
			
		||||
      angle=M_2PI-atan2(dy,dx);
 | 
			
		||||
      angle=M_2PI-atan2((double)dy,(double)dx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (Menu_is_visible)
 | 
			
		||||
@ -1045,8 +1045,7 @@ void Rotate_brush_0_5(void)
 | 
			
		||||
    {
 | 
			
		||||
      dx=cursor_x-Brush_rotation_center_X;
 | 
			
		||||
      dy=cursor_y-Brush_rotation_center_Y;
 | 
			
		||||
      angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy)));
 | 
			
		||||
      if (dy>0) angle=M_2PI-angle;
 | 
			
		||||
      angle=M_2PI-atan2((double)dy, (double)dx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (Menu_is_visible)
 | 
			
		||||
@ -1071,7 +1070,7 @@ void Rotate_brush_0_5(void)
 | 
			
		||||
    computed_y=Brush_rotation_center_Y;
 | 
			
		||||
    switch (Key_ANSI)
 | 
			
		||||
    {
 | 
			
		||||
      case '6': angle=     0.0 ; computed_x++;             break;
 | 
			
		||||
      case '6': angle=      0.0; computed_x++;               break;
 | 
			
		||||
      case '9': angle=M_PI*0.25; computed_x++; computed_y--; break;
 | 
			
		||||
      case '8': angle=M_PI*0.5 ;               computed_y--; break;
 | 
			
		||||
      case '7': angle=M_PI*0.75; computed_x--; computed_y--; break;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user