Fix codestyle issues

They were introduced by b28bfc9602

Contributes to issue CURA-266.
This commit is contained in:
Ghostkeeper 2016-01-22 16:41:07 +01:00
parent 6ef5aeb02b
commit 67c82204ba
2 changed files with 8 additions and 8 deletions

View file

@ -33,8 +33,8 @@ class ImageReader(MeshReader):
depth = img.height() depth = img.height()
largest = max(width, depth) largest = max(width, depth)
width = width/largest*self._ui.defaultWidth width = width / largest * self._ui.defaultWidth
depth = depth/largest*self._ui.defaultDepth depth = depth / largest * self._ui.defaultDepth
self._ui.setWidthAndDepth(width, depth) self._ui.setWidthAndDepth(width, depth)
self._ui.showConfigUI() self._ui.showConfigUI()
@ -109,7 +109,7 @@ class ImageReader(MeshReader):
Job.yieldThread() Job.yieldThread()
if image_color_invert: if image_color_invert:
height_data = 1-height_data height_data = 1 - height_data
for i in range(0, blur_iterations): for i in range(0, blur_iterations):
copy = numpy.pad(height_data, ((1, 1), (1, 1)), mode='edge') copy = numpy.pad(height_data, ((1, 1), (1, 1)), mode='edge')

View file

@ -41,7 +41,7 @@ class ImageReaderUI(QObject):
self._disable_size_callbacks = False self._disable_size_callbacks = False
def setWidthAndDepth(self, width, depth): def setWidthAndDepth(self, width, depth):
self._aspect = width/depth self._aspect = width / depth
self._width = width self._width = width
self._depth = depth self._depth = depth
@ -106,12 +106,12 @@ class ImageReaderUI(QObject):
@pyqtSlot(str) @pyqtSlot(str)
def onWidthChanged(self, value): def onWidthChanged(self, value):
if self._ui_view and not self._disable_size_callbacks: if self._ui_view and not self._disable_size_callbacks:
if (len(value) > 0): if len(value) > 0:
self._width = float(value) self._width = float(value)
else: else:
self._width = 0 self._width = 0
self._depth = self._width/self._aspect self._depth = self._width / self._aspect
self._disable_size_callbacks = True self._disable_size_callbacks = True
self._ui_view.findChild(QObject, "Depth").setProperty("text", str(self._depth)) self._ui_view.findChild(QObject, "Depth").setProperty("text", str(self._depth))
self._disable_size_callbacks = False self._disable_size_callbacks = False
@ -119,12 +119,12 @@ class ImageReaderUI(QObject):
@pyqtSlot(str) @pyqtSlot(str)
def onDepthChanged(self, value): def onDepthChanged(self, value):
if self._ui_view and not self._disable_size_callbacks: if self._ui_view and not self._disable_size_callbacks:
if (len(value) > 0): if len(value) > 0:
self._depth = float(value) self._depth = float(value)
else: else:
self._depth = 0 self._depth = 0
self._width = self._depth*self._aspect self._width = self._depth * self._aspect
self._disable_size_callbacks = True self._disable_size_callbacks = True
self._ui_view.findChild(QObject, "Width").setProperty("text", str(self._width)) self._ui_view.findChild(QObject, "Width").setProperty("text", str(self._width))
self._disable_size_callbacks = False self._disable_size_callbacks = False