Graphics/SvgDiagram.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2992
dbdf27746da5
child 3058
0a02c433f52d
--- a/Graphics/SvgDiagram.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Graphics/SvgDiagram.py	Fri Oct 18 23:00:41 2013 +0200
@@ -10,8 +10,8 @@
 from __future__ import unicode_literals    # __IGNORE_WARNING__
 
 from PyQt4.QtCore import Qt, QSize, QEvent
-from PyQt4.QtGui import QPalette, QSizePolicy, QScrollArea, QAction, QMenu, QToolBar, \
-    QPrinter, QPrintDialog, QPainter, QFont, QColor
+from PyQt4.QtGui import QPalette, QSizePolicy, QScrollArea, QAction, QMenu, \
+    QToolBar, QPrinter, QPrintDialog, QPainter, QFont, QColor
 from PyQt4.QtSvg import QSvgWidget
 
 from E5Gui.E5MainWindow import E5MainWindow
@@ -62,7 +62,8 @@
         
         self.setCentralWidget(self.svgView)
         
-        self.__zoomWidget = E5ZoomWidget(UI.PixmapCache.getPixmap("zoomOut.png"),
+        self.__zoomWidget = E5ZoomWidget(
+            UI.PixmapCache.getPixmap("zoomOut.png"),
             UI.PixmapCache.getPixmap("zoomIn.png"),
             UI.PixmapCache.getPixmap("zoomReset.png"), self)
         self.statusBar().addPermanentWidget(self.__zoomWidget)
@@ -191,9 +192,9 @@
                 self.__doZoom(int(pinch.scaleFactor() * 100))
             evt.accept()
     
-    ############################################################################
+    ###########################################################################
     ## Private menu handling methods below.
-    ############################################################################
+    ###########################################################################
     
     def __adjustScrollBar(self, scrollBar, factor):
         """
@@ -264,7 +265,8 @@
         
         @return current zoom factor in percent (integer)
         """
-        return int(self.svgWidget.width() / self.svgWidget.sizeHint().width() * 100.0)
+        return int(self.svgWidget.width() / 
+                   self.svgWidget.sizeHint().width() * 100.0)
         
     def __printDiagram(self):
         """
@@ -330,18 +332,18 @@
         fm = painter.fontMetrics()
         fontHeight = fm.lineSpacing()
         marginX = printer.pageRect().x() - printer.paperRect().x()
-        marginX = \
-            Preferences.getPrinter("LeftMargin") * int(printer.resolution() / 2.54) \
-            - marginX
+        marginX = Preferences.getPrinter("LeftMargin") * \
+            int(printer.resolution() / 2.54) - marginX
         marginY = printer.pageRect().y() - printer.paperRect().y()
-        marginY = \
-            Preferences.getPrinter("TopMargin") * int(printer.resolution() / 2.54) \
-            - marginY
+        marginY = Preferences.getPrinter("TopMargin") * \
+            int(printer.resolution() / 2.54) - marginY
 
-        width = printer.width() - marginX \
-            - Preferences.getPrinter("RightMargin") * int(printer.resolution() / 2.54)
-        height = printer.height() - fontHeight - 4 - marginY \
-            - Preferences.getPrinter("BottomMargin") * int(printer.resolution() / 2.54)
+        width = printer.width() - marginX - \
+            Preferences.getPrinter("RightMargin") * \
+            int(printer.resolution() / 2.54)
+        height = printer.height() - fontHeight - 4 - marginY - \
+            Preferences.getPrinter("BottomMargin") * \
+            int(printer.resolution() / 2.54)
 
         # write a foot note
         s = self.trUtf8("Diagram: {0}").format(self.getDiagramName())

eric ide

mercurial