From da7e9f41e42ebcc82fe5154d8bde9def958d3166 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Thu, 22 May 2014 17:41:43 +0100 Subject: [PATCH] Variable name change --- fsl/fslview/slicecanvas.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/fsl/fslview/slicecanvas.py b/fsl/fslview/slicecanvas.py index 8b1c9557e..99f904c6b 100644 --- a/fsl/fslview/slicecanvas.py +++ b/fsl/fslview/slicecanvas.py @@ -435,12 +435,12 @@ class SliceCanvas(wxgl.GLCanvas): ev, canvasWidth=None, canvasHeight=None, - realWidth=None, - realHeight=None): + worldWidth=None, + worldHeight=None): """ Calculates the best size to draw the slice, maintaining its aspect ratio, within the current canvas size. The - realWidth/realHeight parameters, if provided, are used + worldWidth/worldHeight parameters, if provided, are used to calculate the displayed world space aspect ratio. If not provided, they are calculated from the min/max bounds of the displayed image list. @@ -454,23 +454,23 @@ class SliceCanvas(wxgl.GLCanvas): # canvas is not yet displayed if canvasWidth == 0 or \ canvasHeight == 0 or \ - realWidth == 0 or \ - realHeight == 0: + worldWidth == 0 or \ + worldHeight == 0: return canvasWidth = float(canvasWidth) canvasHeight = float(canvasHeight) - if realWidth is None: realWidth = float(abs(self.xmax - self.xmin)) - if realHeight is None: realHeight = float(abs(self.ymax - self.ymin)) + if worldWidth is None: worldWidth = float(abs(self.xmax - self.xmin)) + if worldHeight is None: worldHeight = float(abs(self.ymax - self.ymin)) - realRatio = realWidth / realHeight + worldRatio = worldWidth / worldHeight canvasRatio = canvasWidth / canvasHeight - if canvasRatio >= realRatio: - canvasWidth = realWidth * (canvasHeight / realHeight) + if canvasRatio >= worldRatio: + canvasWidth = worldWidth * (canvasHeight / worldHeight) else: - canvasHeight = realHeight * (canvasWidth / realWidth) + canvasHeight = worldHeight * (canvasWidth / worldWidth) canvasWidth = int(np.floor(canvasWidth)) canvasHeight = int(np.floor(canvasHeight)) @@ -484,8 +484,6 @@ class SliceCanvas(wxgl.GLCanvas): self._canvasBBox = [x, y, canvasWidth, canvasHeight] - return canvasWidth, canvasHeight - def _resize(self, bbox=None, -- GitLab