From 46f61df57443fb5f28fbe51cc27df6d7877a56f7 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Tue, 21 Feb 2006 19:53:26 +0000 Subject: [PATCH] Bugfix: Black screen on furniture rearranging: - The range model was not correctly handling the case that the viewport in which we were arranging furniture was bigger than the area that the room wanted to cover. This problem never occurred in 800x600 mode, but could occur at larger resolutions in smaller rooms (such as shacks). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3874 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/VirtualRangeModel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/media/VirtualRangeModel.java b/src/java/com/threerings/media/VirtualRangeModel.java index d327e08d0..fdc80c01b 100644 --- a/src/java/com/threerings/media/VirtualRangeModel.java +++ b/src/java/com/threerings/media/VirtualRangeModel.java @@ -65,13 +65,17 @@ public class VirtualRangeModel value = MathUtil.bound(x, _hrange.getValue(), hmax - vb.width); _hrange.setRangeProperties(value, vb.width, x, hmax, false); } else { - _hrange.setRangeProperties(0, vb.width, 0, vb.width, false); + // Let's center it and lock it down. + int newx = x - (vb.width - width)/2; + _hrange.setRangeProperties(newx, 0, newx, newx, false); } if (height > vb.height) { value = MathUtil.bound(y, _vrange.getValue(), vmax - vb.height); _vrange.setRangeProperties(value, vb.height, y, vmax, false); } else { - _vrange.setRangeProperties(0, vb.height, 0, vb.height, false); + // Let's center it and lock it down. + int newy = y - (vb.height - height)/2; + _vrange.setRangeProperties(newy, 0, newy, newy, false); } }