From 5e98c1aa8cfadcb81cd9ebb61a1e6352c6e16e80 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Fri, 19 Jul 2013 09:13:06 +0200 Subject: [PATCH] Fixed pan bug when reallocating pageview. --- manga/reader.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manga/reader.py b/manga/reader.py index b753042..075d846 100644 --- a/manga/reader.py +++ b/manga/reader.py @@ -213,6 +213,15 @@ class pageview(gtk.Widget): self.allocation = alloc if self.fit: self.zoom = self.fitzoom() + else: + aw, ah = self.get_asize() + zw, zh = self.get_zsize() + ox, oy = self.off + if zw >= aw and ox + aw > zw: + ox = zw - aw + if zh >= ah and oy + ah > zh: + oy = zh - ah + self.off = ox, oy if self.flags() & gtk.REALIZED: self.window.move_resize(*alloc) -- 2.11.0