[qet] [4269] Clean some code

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


Revision: 4269
Author:   scorpio810
Date:     2015-11-19 16:19:45 +0100 (Thu, 19 Nov 2015)
Log Message:
-----------
Clean some code

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/element.cpp
    trunk/sources/qetgraphicsitem/terminal.cpp

Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp	2015-11-18 15:18:58 UTC (rev 4268)
+++ trunk/sources/qetgraphicsitem/element.cpp	2015-11-19 15:19:45 UTC (rev 4269)
@@ -93,24 +93,9 @@
  * @param options
  * @param widget
  */
-void Element::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget)
+void Element::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *)
 {
-	
-#ifndef Q_OS_WIN
-		//Fix visual bug on QGraphicsScene that occur only on X11 with default zoom.
-	QSettings settings;
-	static bool must_correct_rendering_bug = settings.value("correct-rendering", false).toBool();
-	if (must_correct_rendering_bug) {
-		Diagram *dia = diagram();
-		if (dia && options -> levelOfDetail == 1.0 && widget) {
-			// calcule la rotation qu'a subi l'element
-			qreal applied_rotation = 90.0 * orientation();
-			if (applied_rotation == 90.0) painter -> translate(1.0, -1.0);
-			else if (applied_rotation == 180.0) painter -> translate(-1.0, -1.0);
-			else if (applied_rotation == 270.0) painter -> translate(-1.0, 1.0);
-		}
-	}
-#endif
+
 	if (must_highlight_) drawHighlight(painter, options);
 	
 		//Draw the element himself

Modified: trunk/sources/qetgraphicsitem/terminal.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/terminal.cpp	2015-11-18 15:18:58 UTC (rev 4268)
+++ trunk/sources/qetgraphicsitem/terminal.cpp	2015-11-19 15:19:45 UTC (rev 4269)
@@ -221,33 +221,12 @@
 	@param options Les options de dessin
 	@param widget Le widget sur lequel on dessine
 */
-void Terminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, QWidget *widget) {
+void Terminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, QWidget *) {
 	// en dessous d'un certain zoom, les bornes ne sont plus dessinees
 	if (options && options -> levelOfDetail < 0.5) return;
 	
 	p -> save();
-	
-#ifndef Q_OS_WIN
-		//Fix visual bug on QGraphicsScene that occur only on X11 with default zoom.
-	QSettings settings;
-	static bool must_correct_rendering_bug = settings.value("correct-rendering", false).toBool();
-	if (must_correct_rendering_bug) {
-		Diagram *dia = diagram();
-		if (dia && options -> levelOfDetail == 1.0 && widget) {
-			// calcule la rotation qu'a subi l'element
-			qreal applied_rotation = 0.0;
-			if (Element *elt = qgraphicsitem_cast<Element *>(parentItem())) {
-				// orientations actuelle et par defaut de l'element
-				int ori_cur = elt -> orientation();
-				applied_rotation = QET::correctAngle(90.0 * ori_cur);
-			}
-			if (applied_rotation == 90.0) p -> translate(1.0, -1.0);
-			else if (applied_rotation == 180.0) p -> translate(-1.0, -1.0);
-			else if (applied_rotation == 270.0) p -> translate(-1.0, 1.0);
-		}
-	}
-#endif
-	
+
 	//annulation des renderhints
 	p -> setRenderHint(QPainter::Antialiasing,          false);
 	p -> setRenderHint(QPainter::TextAntialiasing,      false);


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