KiCad PCB EDA Suite
draw_context.cpp File Reference

Go to the source code of this file.

Functions

static bool angleIsSpecial (double aRadians)
 
static COLOR4D deemphasise (const COLOR4D &aColor, bool aDeEmphasised)
 

Variables

static constexpr double ANGLE_EPSILON = 1e-9
 

Function Documentation

◆ angleIsSpecial()

static bool angleIsSpecial ( double  aRadians)
static

Definition at line 35 of file draw_context.cpp.

36 {
37  return std::fabs( std::remainder( aRadians, M_PI_4 ) ) < ANGLE_EPSILON;
38 }
static constexpr double ANGLE_EPSILON

References ANGLE_EPSILON.

Referenced by KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight().

◆ deemphasise()

static COLOR4D deemphasise ( const COLOR4D aColor,
bool  aDeEmphasised 
)
static

Definition at line 41 of file draw_context.cpp.

42 {
43  return aColor.WithAlpha( PreviewOverlayDeemphAlpha( aDeEmphasised ) );
44 }
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:321
double PreviewOverlayDeemphAlpha(bool aDeemph=true)
Default alpha of "de-emphasised" features (like previously locked-in lines.

References KIGFX::PREVIEW::PreviewOverlayDeemphAlpha(), and KIGFX::COLOR4D::WithAlpha().

Referenced by KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), and KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight().

Variable Documentation

◆ ANGLE_EPSILON

constexpr double ANGLE_EPSILON = 1e-9
static

Definition at line 33 of file draw_context.cpp.

Referenced by angleIsSpecial().