From: Ricardo Cruz Date: Sat, 12 Jun 2004 15:48:50 +0000 (+0000) Subject: Fixed the scrolling issue. Forgot that the DrawingContext used by gradient was global... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d94b6812ea18ea6dc9f6aed592d2a6766a27c08b;p=supertux.git Fixed the scrolling issue. Forgot that the DrawingContext used by gradient was global and so keep the translation point with the scrolling. Gradient caching should work just fine now. SVN-Revision: 1471 --- diff --git a/src/background.cpp b/src/background.cpp index 830c42296..fcf91f518 100644 --- a/src/background.cpp +++ b/src/background.cpp @@ -109,7 +109,12 @@ Background::draw(DrawingContext& context) if(use_gl) context.draw_gradient(gradient_top, gradient_bottom, LAYER_BACKGROUND0); else + { + context.push_transform(); + context.set_translation(Vector(0, 0)); context.draw_surface(image, Vector(0, 0), LAYER_BACKGROUND0); + context.pop_transform(); + } } else if(type == IMAGE) { int sx = int(-context.get_translation().x * speed) % image->w - image->w;