Fixed pan bug when reallocating pageview.
authorFredrik Tolf <fredrik@dolda2000.com>
Fri, 19 Jul 2013 07:13:06 +0000 (09:13 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Fri, 19 Jul 2013 07:13:06 +0000 (09:13 +0200)
manga/reader.py

index b753042..075d846 100644 (file)
@@ -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)