Redraw seems to work correctly on the Mac now, so only invalidate the shifted region like on other platforms.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@288 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -241,32 +241,25 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
// "), d=(" + dx + ", " + dy +
|
// "), d=(" + dx + ", " + dy +
|
||||||
// "), width=" + width + ", height=" + height + "].");
|
// "), width=" + width + ", height=" + height + "].");
|
||||||
|
|
||||||
|
_dx = dx;
|
||||||
|
_dy = dy;
|
||||||
|
|
||||||
// Mac OS X's redraw breaks on scrolling, so we repaint the
|
// these are used to prevent the vertical strip from
|
||||||
// entire panel
|
// overlapping the horizontal strip
|
||||||
if (RunAnywhere.isMacOS()) {
|
int sy = _ny, shei = height;
|
||||||
_metamgr.getRegionManager().invalidateRegion(_nx, _ny, width, height);
|
|
||||||
} else {
|
|
||||||
_dx = dx;
|
|
||||||
_dy = dy;
|
|
||||||
|
|
||||||
// these are used to prevent the vertical strip from
|
// and add invalid rectangles for the exposed areas
|
||||||
// overlapping the horizontal strip
|
if (dy > 0) {
|
||||||
int sy = _ny, shei = height;
|
shei = Math.max(shei - dy, 0);
|
||||||
|
_metamgr.getRegionManager().invalidateRegion(_nx, _ny + height - dy, width, dy);
|
||||||
// and add invalid rectangles for the exposed areas
|
} else if (dy < 0) {
|
||||||
if (dy > 0) {
|
sy -= dy;
|
||||||
shei = Math.max(shei - dy, 0);
|
_metamgr.getRegionManager().invalidateRegion(_nx, _ny, width, -dy);
|
||||||
_metamgr.getRegionManager().invalidateRegion(_nx, _ny + height - dy, width, dy);
|
}
|
||||||
} else if (dy < 0) {
|
if (dx > 0) {
|
||||||
sy -= dy;
|
_metamgr.getRegionManager().invalidateRegion(_nx + width - dx, sy, dx, shei);
|
||||||
_metamgr.getRegionManager().invalidateRegion(_nx, _ny, width, -dy);
|
} else if (dx < 0) {
|
||||||
}
|
_metamgr.getRegionManager().invalidateRegion(_nx, sy, -dx, shei);
|
||||||
if (dx > 0) {
|
|
||||||
_metamgr.getRegionManager().invalidateRegion(_nx + width - dx, sy, dx, shei);
|
|
||||||
} else if (dx < 0) {
|
|
||||||
_metamgr.getRegionManager().invalidateRegion(_nx, sy, -dx, shei);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user