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

◆ snapAngle()

static double snapAngle ( double  aAngle)
static

Snap an angle to the nearest 45 degrees

Definition at line 32 of file arc_geom_manager.cpp.

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

References KiROUND().

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