kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #18435
[PATCH] GAL arc-drawing crash
In GAL, an assertion (drawing_tool.cpp:925) will fail if you begin
drawing an arc, and then accidentally terminate the arc at zero angle
with the cursor /outside/ the arc radius. It seems that an attempt was
made to check for this but the conditional wasn't written quite right.
Here's a patch to fix the conditional and correctly cancel terminating
the arc instead.
--
Chris
diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp
index adb005e..d4940d0 100644
--- a/pcbnew/tools/drawing_tool.cpp
+++ b/pcbnew/tools/drawing_tool.cpp
@@ -920,7 +920,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic )
case SET_ANGLE:
{
- if( wxPoint( cursorPos.x, cursorPos.y ) != aGraphic->GetArcStart() )
+ if( wxPoint( cursorPos.x, cursorPos.y ) != aGraphic->GetArcStart() && aGraphic->GetAngle() != 0 )
{
assert( aGraphic->GetAngle() != 0 );
assert( aGraphic->GetArcStart() != aGraphic->GetArcEnd() );
Follow ups