[qet] qet/qet: [4754] Revert change because we can't select handler for ellipse

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


Revision: 4754
Author:   blacksun
Date:     2016-10-20 20:57:22 +0200 (Thu, 20 Oct 2016)
Log Message:
-----------
Revert change because we can't select handler for ellipse

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/qetshapeitem.cpp

Modified: trunk/sources/qetgraphicsitem/qetshapeitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/qetshapeitem.cpp	2016-10-20 17:48:10 UTC (rev 4753)
+++ trunk/sources/qetgraphicsitem/qetshapeitem.cpp	2016-10-20 18:57:22 UTC (rev 4754)
@@ -246,27 +246,23 @@
 	pps.setJoinStyle(Qt::RoundJoin);
 	path = pps.createStroke(path);
 
-		/**
-		  Code below is commented to avoid weird bug see : QPainterPath Conductor::shape() const
-		  for more information
-		**/
-//	if (isSelected())
-//	{
-//		QVector <QPointF> vector;
+	if (isSelected())
+	{
+		QVector <QPointF> vector;
 
-//		if (m_shapeType == Line)
-//			vector << m_P1 << m_P2;
-//		else if (m_shapeType == Rectangle || m_shapeType == Ellipse) {
-//			QRectF rect (m_P1, m_P2);
-//			vector << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft();
-//		}
-//		else
-//			vector = m_polygon;
+		if (m_shapeType == Line)
+			vector << m_P1 << m_P2;
+		else if (m_shapeType == Rectangle || m_shapeType == Ellipse) {
+			QRectF rect (m_P1, m_P2);
+			vector << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft();
+		}
+		else
+			vector = m_polygon;
 
-//		foreach(QRectF r, m_handler.handlerRect(vector))
-//			path.addRect(r);
-//	}
-
+		foreach(QRectF r, m_handler.handlerRect(vector))
+			path.addRect(r);
+	}
+	path.addRect(path.boundingRect());
 	return (path);
 }
 


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