[commit] r2755 - trunk/GME/Gme/AutoRoute
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Thu Jul 19 11:07:48 CDT 2018
Author: ksmyth
Date: Thu Jul 19 11:07:47 2018
New Revision: 2755
Log:
AutoRouter: be more resilient to overlapping and adjacent boxes
Modified:
trunk/GME/Gme/AutoRoute/AutoRouterGraph.cpp
Modified: trunk/GME/Gme/AutoRoute/AutoRouterGraph.cpp
==============================================================================
--- trunk/GME/Gme/AutoRoute/AutoRouterGraph.cpp Mon Jul 9 13:55:36 2018 (r2754)
+++ trunk/GME/Gme/AutoRoute/AutoRouterGraph.cpp Thu Jul 19 11:07:47 2018 (r2755)
@@ -8,6 +8,8 @@
#include "AutoRouterEdge.h"
+// #define ASSERT(x) do { if (!(x)) DebugBreak(); } while (false)
+
// --- CAutoRouterGraph
CAutoRouterGraph::CAutoRouterGraph():
@@ -492,7 +494,13 @@
ASSERT( !IsPointInDirFrom(start, rect, dir2) );
GoToNextBox(start, dir2, end);
// this assert fails if two boxes are adjacent, and a connection wants to go between
+ // or this assert fails if two boxes are overlapping. This can happen if the decorator got bigger (e.g. due to ports change) and now the boxes overlap (and we forgot to reset the model grid)
ASSERT( IsPointInDirFrom(start, rect, dir2) );
+ // avoid infinite loop by giving up
+ if (!IsPointInDirFrom(start, rect, dir2)) {
+ retend = ret.InsertAfter(retend, end);
+ return;
+ }
}
else
{
More information about the gme-commit
mailing list