Minor optimization for collision checking

Prevents extra center point calculations
This commit is contained in:
Seth Hillbrand 2022-03-04 11:23:24 -08:00
parent 8218f9ab44
commit 3c2eb9311f
1 changed files with 4 additions and 2 deletions

View File

@ -319,11 +319,13 @@ void SHAPE_ARC::update_bbox()
int quad_angle_start = std::ceil( start_angle.AsDegrees() / 90.0 );
int quad_angle_end = std::floor( end_angle.AsDegrees() / 90.0 );
VECTOR2I center = GetCenter();
const int radius = KiROUND( GetRadius() );
// count through quadrants included in arc
for( int quad_angle = quad_angle_start; quad_angle <= quad_angle_end; ++quad_angle )
{
const int radius = KiROUND( GetRadius() );
VECTOR2I quad_pt = GetCenter();
VECTOR2I quad_pt = center;
switch( quad_angle % 4 )
{