[qet] [2950] cross ref item: improve improve the position of the comment at the bottom of the cross

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2950
Author:   blacksun
Date:     2014-03-28 11:33:14 +0100 (Fri, 28 Mar 2014)
Log Message:
-----------
cross ref item: improve improve the position of the comment at the bottom of the cross 

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/crossrefitem.cpp
    trunk/sources/qetgraphicsitem/crossrefitem.h

Modified: trunk/sources/qetgraphicsitem/crossrefitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-03-28 03:15:29 UTC (rev 2949)
+++ trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-03-28 10:33:14 UTC (rev 2950)
@@ -86,8 +86,8 @@
 
 	//draw the cross
 	QRectF br = boundingRect();
-	qp.drawLine(br.width()/2, 0, br.width()/2, br.height()-9);		//vertical line
-	qp.drawLine(br.width()/2-25, header, br.width()/2+25, header);  //horizontal line
+	qp.drawLine(br.width()/2, 0, br.width()/2, br.height() - text_rect_.height());	//vertical line
+	qp.drawLine(br.width()/2-25, header, br.width()/2+25, header);					//horizontal line
 
 	//draw the symbolic NO
 	qreal xoffset = br.width()/2 - 25;
@@ -105,9 +105,6 @@
 		QPointF(xoffset+5, 3),
 		QPointF(xoffset+10, 3),
 		QPointF(xoffset+10, 0)
-		/*QPointF(30, 3),
-		QPointF(35, 3),
-		QPointF(35, 0),*/
 	};
 	qp.drawPolyline(p2,3);
 	QPointF p3[3] = {
@@ -248,7 +245,7 @@
 		painter.save();
 		painter.setFont(QETApp::diagramTextsFont(6));
 		//calcule the size au graphic text
-		text_rect_ = QRectF(default_bounding.bottomLeft(), QPointF(default_bounding.bottomRight().x(), default_bounding.bottomRight().y()-9));
+		text_rect_ = QRectF(default_bounding.bottomLeft(), QPointF(default_bounding.bottomRight().x(), default_bounding.bottomRight().y()-1));
 		text_rect_ = painter.boundingRect(text_rect_, Qt::AlignHCenter ,comment);
 		bounding_rect_.setSize(default_bounding.united(text_rect_).size());
 
@@ -262,6 +259,7 @@
 		}
 		painter.restore();
 	}
+	else text_rect_ = QRectF();
 }
 
 /**

Modified: trunk/sources/qetgraphicsitem/crossrefitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.h	2014-03-28 03:15:29 UTC (rev 2949)
+++ trunk/sources/qetgraphicsitem/crossrefitem.h	2014-03-28 10:33:14 UTC (rev 2950)
@@ -63,7 +63,6 @@
 	QRectF bounding_rect_ , text_rect_;
 	QPicture drawing_;
 	QPainterPath shape_path_;
-
 };
 
 #endif // CROSSREFITEM_H


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/