]> Shamusworld >> Repos - architektonas/blobdiff - src/drawingview.cpp
Fixed Line rendering to keep attached Dimensions correct length with 'Fix Len'
[architektonas] / src / drawingview.cpp
index 911b2bac0cbeb232ccfa438e4e1e8b49d560b2bb..55b56e7d87e02ae0aa5cbd1b1e4c428ffca9ebb2 100644 (file)
@@ -50,14 +50,18 @@ DrawingView::DrawingView(QWidget * parent/*= NULL*/): QWidget(parent),
 //     setCursor(cur[TOOLSelect]);
 //     setMouseTracking(true);
 
-       document.Add(new Line(Vector(5, 5), Vector(50, 40), &document));
+       Line * line = new Line(Vector(5, 5), Vector(50, 40), &document);
+       document.Add(line);
        document.Add(new Line(Vector(50, 40), Vector(10, 83), &document));
        document.Add(new Line(Vector(10, 83), Vector(17, 2), &document));
        document.Add(new Circle(Vector(100, 100), 36, &document));
        document.Add(new Circle(Vector(50, 150), 49, &document));
        document.Add(new Arc(Vector(300, 300), 32, PI / 4.0, PI * 1.3, &document)),
        document.Add(new Arc(Vector(200, 200), 60, PI / 2.0, PI * 1.5, &document));
-       document.Add(new Dimension(Vector(5, 5), Vector(50, 40), &document));
+       Dimension * dimension = new Dimension(Vector(0, 0), Vector(0, 0), &document);
+       line->SetDimensionOnPoint1(dimension);
+       line->SetDimensionOnPoint2(dimension);
+       document.Add(dimension);
 }
 
 QPoint DrawingView::GetAdjustedMousePosition(QMouseEvent * event)