[qet] qet/qet: [5022] Commit 5005 break the change made in commit 5003 : fix it

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


Revision: 5022
Author:   blacksun
Date:     2017-08-16 16:32:34 +0200 (Wed, 16 Aug 2017)
Log Message:
-----------
Commit 5005 break the change made in commit 5003 : fix it

Modified Paths:
--------------
    trunk/sources/diagramview.cpp

Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp	2017-08-16 13:52:15 UTC (rev 5021)
+++ trunk/sources/diagramview.cpp	2017-08-16 14:32:34 UTC (rev 5022)
@@ -416,6 +416,7 @@
 	}
 	m_diagram->adjustSceneRect();
 	adjustGridToZoom();
+	adjustSceneRect();
 }
 
 /**
@@ -542,6 +543,7 @@
 		m_rubber_band_origin = e -> pos();
 		h -> setValue(h -> value() + pos.x());
 		v -> setValue(v -> value() + pos.y());
+		adjustSceneRect();
 	}
 
 	else QGraphicsView::mouseMoveEvent(e);
@@ -928,12 +930,21 @@
 /**
  * @brief DiagramView::adjustSceneRect
  * Calcul and set the area of the scene visualized by this view
- * The area are diagram sceneRect * 2.
  */
 void DiagramView::adjustSceneRect()
 {
 	QRectF scene_rect = m_diagram->sceneRect();
 	scene_rect.adjust(-Diagram::margin, -Diagram::margin, Diagram::margin, Diagram::margin);
+	
+	QSettings settings;
+	if (settings.value("diagrameditor/zoom-out-beyond-of-folio", false).toBool())
+	{
+			//When zoom out beyong of folio is active,
+			//we always adjust the scene rect to be 1/3 bigger than the wiewport
+		QRectF vpbr = mapToScene(viewport()->rect()).boundingRect();
+		vpbr.adjust(0, 0, vpbr.width()/3, vpbr.height()/3);
+		scene_rect = scene_rect.united(vpbr);
+	}
 	setSceneRect(scene_rect);
 }
 


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