From b1396cd70a0b2149edf633cb1d2d76e4e80f255d Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Fri, 7 Feb 2014 21:06:42 -0700 Subject: [PATCH] Fixed a bug with images getting pushed around at the top of the page. --- jgui/surface/surface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jgui/surface/surface.py b/jgui/surface/surface.py index b7209a4..0613478 100644 --- a/jgui/surface/surface.py +++ b/jgui/surface/surface.py @@ -176,12 +176,12 @@ class WindowSurface(object): if center_horizontal: x += width/2.0 - new_width/2.0 - if x < 0: - x = 0 + if x < self.position.x: + x = self.position.x if center_vertical: y += height/2.0 - new_height/2.0 - if y < 0: - y = 0 + if y < self.position.y: + y = self.position.y im_surf = cairo.ImageSurface(cairo.FORMAT_ARGB32, int(new_width), int(new_height))