From 922fdc292f0335a22d3e0b838d0b9ed448728b0e Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 19 Feb 2002 07:20:13 +0000 Subject: [PATCH] Have to translate invalidated rectangles according to our viewport translations for everything to work out. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1038 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/miso/client/SceneViewPanel.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/miso/client/SceneViewPanel.java b/src/java/com/threerings/miso/client/SceneViewPanel.java index 6ee8b6345..0638ecbf6 100644 --- a/src/java/com/threerings/miso/client/SceneViewPanel.java +++ b/src/java/com/threerings/miso/client/SceneViewPanel.java @@ -1,5 +1,5 @@ // -// $Id: SceneViewPanel.java,v 1.31 2002/02/19 05:03:17 mdb Exp $ +// $Id: SceneViewPanel.java,v 1.32 2002/02/19 07:20:13 mdb Exp $ package com.threerings.miso.scene; @@ -149,6 +149,14 @@ public class SceneViewPanel extends AnimatedPanel // documentation inherited protected void render (Graphics2D gfx, List invalidRects) { + // we have to translate all of the invalid rects into our + // translated coordinate space before passing them on to the + // underlying view code + int isize = invalidRects.size(); + for (int i = 0; i < isize; i++) { + ((Rectangle)invalidRects.get(i)).translate(_tx, _ty); + } + // translate into happy space gfx.translate(-_tx, -_ty); @@ -160,6 +168,13 @@ public class SceneViewPanel extends AnimatedPanel // translate back out of happy space gfx.translate(_tx, _ty); + + // now we translate them back out (because the animated panel + // needs to use them as they were); we translate in and out rather + // than copy them to save on object creation overhead + for (int i = 0; i < isize; i++) { + ((Rectangle)invalidRects.get(i)).translate(-_tx, -_ty); + } } /**