]> Shamusworld >> Repos - architektonas/blobdiff - src/widgets/qg_graphicview.cpp
Beginnings of new render path (Snapper)...
[architektonas] / src / widgets / qg_graphicview.cpp
index e306fa608d12511c0efba712c2e0e8f7f6a82a70..57c826758de613121b8ccf96edab7a95310f6724 100644 (file)
@@ -71,14 +71,14 @@ QG_GraphicView::QG_GraphicView(RS_Document * doc, QWidget * parent)
 void QG_GraphicView::CommonInitialization(void)
 {
        setBackground(background);
-       buffer = NULL;
+//meh  buffer = NULL;
        lastWidth = 0;
        lastHeight = 0;
 //hrm.
 painter = NULL;
 
        RS_DEBUG->print("--> Setting up layout...");
-       layout = new QGridLayout(this);
+       QGridLayout * layout = new QGridLayout(this);
        layout->setColumnStretch(0, 1);
        layout->setColumnStretch(1, 0);
        layout->setColumnStretch(2, 0);
@@ -183,11 +183,11 @@ QG_GraphicView::~QG_GraphicView()
        if (painter)
                delete painter;
 
-       if (buffer)
-       {
-               delete buffer;
-               buffer = NULL;
-       }
+//meh  if (buffer)
+//     {
+//             delete buffer;
+//             buffer = NULL;
+//     }
 
        cleanUp();
 }
@@ -899,6 +899,9 @@ What's needed:
        }
 #endif
 
+       if (snapper.Visible())
+               snapper.Draw(this, painter);
+#if 0
        if (snapperDraw)
 //     if (false)
        {
@@ -912,7 +915,7 @@ What's needed:
 //Actually, it looks like buggy painting code in PaintInterface()...
                        painter->drawCircle(toGui(snapCoord1), 4);
 
-#if 1
+       #if 1
                        // crosshairs:
                        if (showCrosshairs1 == true)
                        {
@@ -922,9 +925,9 @@ What's needed:
                                painter->drawLine(Vector(toGuiX(snapCoord1.x), 0),
                                        Vector(toGuiX(snapCoord1.x), getHeight()));
                        }
-#endif
+       #endif
                }
-#if 1
+       #if 1
                if (snapCoord1.valid && snapCoord1 != snapSpot1)
                {
                        painter->drawLine(toGui(snapSpot1) + Vector(-5, 0), toGui(snapSpot1) + Vector(-1, 4));
@@ -932,8 +935,9 @@ What's needed:
                        painter->drawLine(toGui(snapSpot1) + Vector(5, 0), toGui(snapSpot1) + Vector(1, -4));
                        painter->drawLine(toGui(snapSpot1) + Vector(0, -5), toGui(snapSpot1) + Vector(-4, -1));
                }
-#endif
+       #endif
        }
+#endif
 
        delete painter;
        painter = NULL;