From ad6112aa9ed425af31640f127cadec0bc41d255e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Tue, 5 Nov 2013 19:14:42 +0100 Subject: [PATCH] fixed ProgressCanvas.update_image for scaled images --- pysstv/examples/gimp-plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pysstv/examples/gimp-plugin.py b/pysstv/examples/gimp-plugin.py index 09a6899..12613f8 100755 --- a/pysstv/examples/gimp-plugin.py +++ b/pysstv/examples/gimp-plugin.py @@ -70,6 +70,7 @@ class Transmitter(object): class ProgressCanvas(Canvas): def __init__(self, master, image): + self.height_ratio = 1 width, height = image.size pixels = image.load() RED, GREEN, BLUE = range(3) @@ -83,6 +84,7 @@ class ProgressCanvas(Canvas): elif width < 200: width *= 2 height *= 2 + self.height_ratio = 2 if (width, height) != image.size: image = image.resize((width, height)) Canvas.__init__(self, master, width=width, height=height) @@ -93,7 +95,9 @@ class ProgressCanvas(Canvas): image = self.tk_img self.create_image(0, 0, anchor=NW, image=image) if line is not None: - self.create_line(0, line, image.width(), line, fill=self.colors[line]) + fill = self.colors[line] + line *= self.height_ratio + self.create_line(0, line, image.width(), line, fill=fill) def transmit_current_image(image, drawable, mode, vox, fskid):