Procházet zdrojové kódy

fixed canvas resize issue

subDesTagesMitExtraKaese před 4 roky
rodič
revize
307f65ccc9
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  1. 2 4
      raspberry-pi/gui/graph.py

+ 2 - 4
raspberry-pi/gui/graph.py

@@ -26,11 +26,9 @@ class Graph(tk.Canvas):
 
 
   def on_resize(self,event):
-    # determine the ratio of old width/height to new width/height
-    self.width = max(400, event.width-4)
-    self.height = max(400, event.height-4)
+    self.width = max(100, event.width-4)
+    self.height = max(100, event.height-4)
     # resize the canvas 
-    self.config(width=self.width, height=self.height)
     self.canvas = self.canvas.resize((self.width, self.height))
     self.drawBackground()
     self.canvas = Image.blend(self.canvas, self.bg, 0.1)