From 5adb444f3e523d3fd028617ced72d1ea6661db21 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Thu, 4 Nov 2010 13:56:20 +0000 Subject: [PATCH] Bugfixes related to removing Snapper class. --- src/actions/actiondefault.cpp | 1 - src/actions/actiondimaligned.cpp | 1 - src/base/entitycontainer.cpp | 28 ++++++++++++++-------------- src/base/preview.cpp | 13 ++++--------- src/mainapp/graphicview.h | 1 - 5 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/actions/actiondefault.cpp b/src/actions/actiondefault.cpp index 74e77dd..a1219df 100644 --- a/src/actions/actiondefault.cpp +++ b/src/actions/actiondefault.cpp @@ -23,7 +23,6 @@ #include "line.h" #include "modification.h" #include "preview.h" -#include "snapper.h" #include "selection.h" /** diff --git a/src/actions/actiondimaligned.cpp b/src/actions/actiondimaligned.cpp index cd30076..73306fc 100644 --- a/src/actions/actiondimaligned.cpp +++ b/src/actions/actiondimaligned.cpp @@ -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) diff --git a/src/base/entitycontainer.cpp b/src/base/entitycontainer.cpp index ec5840f..dc247e7 100644 --- a/src/base/entitycontainer.cpp +++ b/src/base/entitycontainer.cpp @@ -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); + //} } /** diff --git a/src/base/preview.cpp b/src/base/preview.cpp index b0d6066..c108600 100644 --- a/src/base/preview.cpp +++ b/src/base/preview.cpp @@ -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) diff --git a/src/mainapp/graphicview.h b/src/mainapp/graphicview.h index cb684c0..65e1a3d 100644 --- a/src/mainapp/graphicview.h +++ b/src/mainapp/graphicview.h @@ -5,7 +5,6 @@ #include "enums.h" #include "color.h" #include "preview.h" -#include "snapper.h" #include "vector.h" class ActionInterface; -- 2.37.2