From 6b651c2f9ca5e2d4124c3914bd94a86ecd84dd62 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 30 Oct 2002 00:27:37 +0000 Subject: [PATCH] Don't request to dirty an invalid region if we scroll more than an entire screen vertically, instead request to dirty one with zero height. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1862 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/media/VirtualMediaPanel.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/media/VirtualMediaPanel.java b/src/java/com/threerings/media/VirtualMediaPanel.java index 7dbf8e2a9..35ef4d5c3 100644 --- a/src/java/com/threerings/media/VirtualMediaPanel.java +++ b/src/java/com/threerings/media/VirtualMediaPanel.java @@ -1,5 +1,5 @@ // -// $Id: VirtualMediaPanel.java,v 1.10 2002/09/16 23:34:55 mdb Exp $ +// $Id: VirtualMediaPanel.java,v 1.11 2002/10/30 00:27:37 mdb Exp $ package com.threerings.media; @@ -182,13 +182,18 @@ public class VirtualMediaPanel extends MediaPanel // determine how far we'll be moving on this tick _dx = _nx - _tx; _dy = _ny - _ty; + Log.info("Scrolling into place [n=(" + _nx + ", " + _ny + + "), t=(" + _tx + ", " + _ty + + "), d=(" + _dx + ", " + _dy + + "), width=" + width + ", height=" + height + "]."); + // these are used to prevent the vertical strip from // overlapping the horizontal strip int sy = _ny, shei = height; // and add invalid rectangles for the exposed areas if (_dy > 0) { - shei -= _dy; + shei = Math.max(shei - _dy, 0); _remgr.invalidateRegion(_nx, _ny + height - _dy, width, _dy); } else if (_dy < 0) { sy -= _dy; @@ -204,10 +209,6 @@ public class VirtualMediaPanel extends MediaPanel // between here and the call to paint() for this tick don't // booch everything _tx = _nx; _ty = _ny; - -// Log.info("Scrolling into place " + -// "[dx=" + _dx + ", dy=" + _dy + -// ", tx=" + _tx + ", ty=" + _ty + "]."); } }