[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/plugins/reportspgz/backend/wrtembed
From:       Adam Pigg <adam () piggz ! co ! uk>
Date:       2008-06-30 19:52:54
Message-ID: 1214855574.132790.11201.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 826463 by piggz:

Resize objects in all directions

 M  +16 -6     reportrectentity.cpp  


--- trunk/koffice/kexi/plugins/reportspgz/backend/wrtembed/reportrectentity.cpp \
#826462:826463 @@ -115,9 +115,8 @@
 
 void ReportRectEntity::mouseMoveEvent ( QGraphicsSceneMouseEvent * event )
 {
-	int w;
-	int h;
-	
+	qreal w,h;
+
 	QPointF p  = dynamic_cast<ReportScene*>(scene())->gridPoint(event->scenePos());
 	w = p.x() - scenePos().x();
 	h = p.y() - scenePos().y();
@@ -128,26 +127,37 @@
 	switch(_grabAction)
 	{
 		case 1:
+			if (sceneRect().y() - p.y() + rect().height() > 0 && sceneRect().x() - p.x() + \
rect().width() > 0) +			setSceneRect(QPointF(p.x(), p.y()), QSizeF(sceneRect().x() - \
p.x() + rect().width(), sceneRect().y() - p.y() + rect().height()));  break;
 		case 2:
+			if (sceneRect().y() - p.y() + rect().height() > 0)
+			setSceneRect(QPointF(sceneRect().x(), p.y()), QSizeF(rect().width(), \
sceneRect().y() - p.y() + rect().height()));  break;
 		case 3:
+			if (sceneRect().y() - p.y() + rect().height() > 0 && w > 0)
+			setSceneRect(QPointF(sceneRect().x(), p.y()), QSizeF(w, sceneRect().y() - p.y() + \
rect().height()));  break;
 		case 4:
 			if (w > 0)
-			setRect (0,0, w, (int)(rect().height()));
+			setSceneRect (QPointF(sceneRect().x(), sceneRect().y()), QSizeF(w, \
(rect().height())));  break;
 		case 5:
 			if ( h> 0 && w > 0)
-			setRect ( 0,0, w,h );
+			setSceneRect ( QPointF(sceneRect().x(), sceneRect().y()), QSizeF(w,h) );
 			break;
 		case 6:
 			if (h > 0)
-			setRect (0,0,(int)(rect().width()), h);
+			setSceneRect (QPointF(sceneRect().x(), sceneRect().y()),QSizeF((rect().width()), \
h));  break;
 		case 7:
+			if (sceneRect().x() - p.x() + rect().width() > 0 && h > 0)
+			setSceneRect(QPointF(p.x(), sceneRect().y()), QSizeF(sceneRect().x() - p.x() + \
rect().width(), h));  break;
+			break;
 		case 8:
+			if (sceneRect().x() - p.x() + rect().width() > 0 )
+			setSceneRect(QPointF(p.x(), sceneRect().y()), QSizeF(sceneRect().x() - p.x() + \
rect().width(), rect().height()));  break;	
 		default:
 			QGraphicsItem::mouseMoveEvent(event);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic