]> Shamusworld >> Repos - architektonas/commitdiff
Bugfixes related to removing Snapper class.
authorShamus Hammons <jlhamm@acm.org>
Thu, 4 Nov 2010 13:56:20 +0000 (13:56 +0000)
committerShamus Hammons <jlhamm@acm.org>
Thu, 4 Nov 2010 13:56:20 +0000 (13:56 +0000)
src/actions/actiondefault.cpp
src/actions/actiondimaligned.cpp
src/base/entitycontainer.cpp
src/base/preview.cpp
src/mainapp/graphicview.h

index 74e77ddb45eb81cd9a4620ff75fa6fa87c5e662a..a1219df0b1793fce779823f552c7aba7c77c6854 100644 (file)
@@ -23,7 +23,6 @@
 #include "line.h"
 #include "modification.h"
 #include "preview.h"
-#include "snapper.h"
 #include "selection.h"
 
 /**
index cd3007639dc1ab645712b3593ae53a6b3a130bd5..73306fcf53a5388a03f5441c72fb5f39ab7df589 100644 (file)
@@ -22,7 +22,6 @@
 #include "dialogfactory.h"
 #include "graphicview.h"
 #include "preview.h"
-#include "snapper.h"
 
 ActionDimAligned::ActionDimAligned(EntityContainer & container, GraphicView & graphicView): ActionDimension("Draw aligned dimensions",
                container, graphicView)
index ec5840fb906d91896914db8cd22d471980941138..dc247e76ba736cce38e44cdb1201b0a927aed9c4 100644 (file)
@@ -473,22 +473,22 @@ void EntityContainer::adjustBorders(Entity * entity)
        //DEBUG->print("EntityContainer::adjustBorders");
        //resetBorders();
 
-       if (entity != NULL)
-       {
-               // make sure a container is not empty (otherwise the border
-               //   would get extended to 0/0):
-               if (!entity->isContainer() || entity->count() > 0)
-               {
-                       minV = Vector::minimum(entity->getMin(), minV);
-                       maxV = Vector::maximum(entity->getMax(), maxV);
-               }
+       if (entity == NULL)
+               return;
 
-               // Notify parents. The border for the parent might
-               // also change TODO: Check for efficiency
-               //if(parent!=NULL) {
-               //parent->adjustBorders(this);
-               //}
+       // make sure a container is not empty (otherwise the border
+       //   would get extended to 0/0):
+       if (!entity->isContainer() || entity->count() > 0)
+       {
+               minV = Vector::minimum(entity->getMin(), minV);
+               maxV = Vector::maximum(entity->getMax(), maxV);
        }
+
+       // Notify parents. The border for the parent might
+       // also change TODO: Check for efficiency
+       //if(parent!=NULL) {
+       //parent->adjustBorders(this);
+       //}
 }
 
 /**
index b0d60664dca741a7cedfb869e4740d51f2c8ef50..c108600a7371fc0b1c73529d16939ead232c7b49 100644 (file)
@@ -49,9 +49,7 @@ void Preview::addEntity(Entity * entity)
        if (entity == NULL || entity->isUndone())
                return;
 
-       // only border preview for complex entities:
-       //if ((entity->count() > maxEntities-count()) &&
-
+       // Only border preview for complex entities:
        bool addBorder = false;
 
        if (entity->rtti() == RS2::EntityImage || entity->rtti() == RS2::EntityHatch
@@ -59,13 +57,10 @@ void Preview::addEntity(Entity * entity)
        {
                addBorder = true;
        }
-       else
+       else if (entity->isContainer() && entity->rtti() != RS2::EntitySpline)
        {
-               if (entity->isContainer() && entity->rtti() != RS2::EntitySpline)
-               {
-                       if (entity->countDeep() > maxEntities-countDeep())
-                               addBorder = true;
-               }
+               if (entity->countDeep() > maxEntities - countDeep())
+                       addBorder = true;
        }
 
        if (addBorder)
index cb684c060aef93b3f75ed173c92a1f2134c1dff6..65e1a3d5d6c8235fc1ea4099460b90e7c2fb594b 100644 (file)
@@ -5,7 +5,6 @@
 #include "enums.h"
 #include "color.h"
 #include "preview.h"
-#include "snapper.h"
 #include "vector.h"
 
 class ActionInterface;