KiCad PCB EDA Suite
arc_geom_manager.cpp File Reference

Go to the source code of this file.

Functions

static double snapAngle (double aAngle)
 

Snap an angle to the nearest 45 degrees

More...
 

Function Documentation

static double snapAngle ( double  aAngle)
static

Snap an angle to the nearest 45 degrees

Definition at line 32 of file arc_geom_manager.cpp.

References KiROUND().

Referenced by KIGFX::PREVIEW::ARC_GEOM_MANAGER::setEnd(), and KIGFX::PREVIEW::ARC_GEOM_MANAGER::setStart().

33 {
34  return KiROUND( aAngle / M_PI_4 ) * M_PI_4;
35 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107