]> Shamusworld >> Repos - architektonas/blobdiff - src/mainapp/graphicview.cpp
Still in the middle of fixing preview/snapper rendering...
[architektonas] / src / mainapp / graphicview.cpp
index d3c19fff4d28109e7419b1fd0e63fba6d8fb1819..77c74042ec3198c1e1f34f68f00662f54c53cbad 100644 (file)
@@ -363,10 +363,10 @@ bool GraphicView::isGridOn()
 {
        if (container)
        {
-               Drawing * g = container->getGraphic();
+               Drawing * d = container->getGraphic();
 
-               if (g)
-                       return g->isGridOn();
+               if (d)
+                       return d->isGridOn();
        }
 
        return true;
@@ -1411,18 +1411,6 @@ void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db)
        //RS_DEBUG->print("GraphicView::drawEntity() end");
 }
 
-/**
- * Deletes an entity with the background color.
- * Might be recusively called e.g. for polylines.
- */
-void GraphicView::deleteEntity(RS_Entity * e)
-{
-#warning "!!! This is part of obsolete rendering !!!"
-       setDeleteMode(true);
-       drawEntity(e);
-       setDeleteMode(false);
-}
-
 /**
  * Draws an entity.
  * The painter must be initialized and all the attributes (pen) must be set.
@@ -1487,15 +1475,15 @@ void GraphicView::simulateIt()
  */
 void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen)
 {
-       if (painter == NULL || e == NULL)
+       if (!painter || !e)
                return;
 
        if (e->isContainer())
        {
                RS_EntityContainer * ec = (RS_EntityContainer *)e;
 
-               for(RS_Entity* en=ec->firstEntity(RS2::ResolveNone);
-                               en!=NULL; en = ec->nextEntity(RS2::ResolveNone))
+               for(RS_Entity * en=ec->firstEntity(RS2::ResolveNone);
+                       en!=NULL; en=ec->nextEntity(RS2::ResolveNone))
                {
                        if (en->isVisible() && en->isUndone() == false)
                        {
@@ -1925,18 +1913,20 @@ void GraphicView::drawRelativeZero()
 //Using Qt::red doesn't seem to work here...
        RS_Pen p(RS_Color(255, 0, 0), RS2::Width00, RS2::SolidLine);
        painter->setPen(p);
-       painter->setXORMode();
+//This doesn't work--this is NOT a QPainter!
+//     painter->setBrush(Qt::NoBrush);
+//     painter->setBackgroundMode(Qt::TransparentMode);        // will that do it???
+       painter->disableBrush();
+//     painter->setXORMode();
 
        int zr = 5;
 
        painter->drawLine(Vector(toGuiX(relativeZero.x) - zr, toGuiY(relativeZero.y)),
                Vector(toGuiX(relativeZero.x) + zr, toGuiY(relativeZero.y)));
-
        painter->drawLine(Vector(toGuiX(relativeZero.x), toGuiY(relativeZero.y) - zr),
                Vector(toGuiX(relativeZero.x), toGuiY(relativeZero.y) + zr));
-
        painter->drawCircle(toGui(relativeZero), zr);
-       painter->setNormalMode();
+//     painter->setNormalMode();
 }
 
 /**
@@ -2120,7 +2110,7 @@ Vector GraphicView::toGui(Vector v)
  * @param visible Pointer to a boolean which will contain true
  * after the call if the coordinate is within the visible range.
  */
-double GraphicView::toGuiX(double x, bool * visible)
+double GraphicView::toGuiX(double x, bool * visible/*= NULL*/)
 {
        if (visible != NULL)
        {