# HG changeset patch # User Simon Cross # Date 1259191510 0 # Node ID a2824eb2474e03bba5573664b89e1fc4b38d9775 # Parent bf90a2948e34dcc58008f80a0f9ee49993077420 Only include top widget when creating snapshot. diff -r bf90a2948e34 -r a2824eb2474e gamelib/gameboard.py --- a/gamelib/gameboard.py Wed Nov 25 23:15:56 2009 +0000 +++ b/gamelib/gameboard.py Wed Nov 25 23:25:10 2009 +0000 @@ -973,8 +973,12 @@ def snapshot(self, scale=0.25): """Return a snapshot of the gameboard.""" w, h = self.disp.screen.get_size() - w, h = int(w * scale), int(h * scale) - snapshot = pygame.transform.smoothscale(self.disp.screen, (w, h)) + snap_w, snap_h = int(w * scale), int(h * scale) + dummy_screen = pygame.surface.Surface((w, h), 0, self.disp.screen) + top_widget = self.get_top_widget() + + top_widget.paint(dummy_screen) + snapshot = pygame.transform.smoothscale(dummy_screen, (snap_w, snap_h)) return snapshot def save_game(self):