From b09d90c12f0957841ee5332cc8f1524a4fc6a385 Mon Sep 17 00:00:00 2001 From: "Egli Adrian (IT-SCI-API-PFI)" <adrian.egli@sbb.ch> Date: Wed, 29 May 2019 07:56:59 +0200 Subject: [PATCH] auto scale for PIL --- flatland/utils/graphics_pil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index 51b7551..cadc2e5 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -28,9 +28,9 @@ class PILGL(GraphicsLayer): self.screen_height = min(self.screen_height,m.height) self.screen_width = min(self.screen_width,m.width) - self.widthPx = 0.95*self.screen_width/(self.width + 1 + self.linewidth) - self.heightPx = 0.95*self.screen_height/(self.height + 1 + self.linewidth) - self.nPixCell = int(max(1,np.floor(min(self.widthPx,self.heightPx)))) + w = 0.95*self.screen_width/(self.width + 1 + self.linewidth) + h = 0.95*self.screen_height/(self.height + 1 + self.linewidth) + self.nPixCell = int(max(1,np.floor(min(w,h)))) # Total grid size at native scale -- GitLab