Small fix: if we're bypassing the copyArea scrolling on a macintosh
and just dirtying the entire panel, we don't want to set _dx and _dy, as that will trigger the actual use of copyArea and so forth during painting. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3232 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -222,7 +222,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
// regions for the area exposed by the scrolling
|
// regions for the area exposed by the scrolling
|
||||||
if (_nx != _vbounds.x || _ny != _vbounds.y) {
|
if (_nx != _vbounds.x || _ny != _vbounds.y) {
|
||||||
// determine how far we'll be moving on this tick
|
// determine how far we'll be moving on this tick
|
||||||
_dx = _nx - _vbounds.x; _dy = _ny - _vbounds.y;
|
int dx = _nx - _vbounds.x, dy = _ny - _vbounds.y;
|
||||||
|
|
||||||
// Log.info("Scrolling into place [n=(" + _nx + ", " + _ny +
|
// Log.info("Scrolling into place [n=(" + _nx + ", " + _ny +
|
||||||
// "), t=(" + _vbounds.x + ", " + _vbounds.y +
|
// "), t=(" + _vbounds.x + ", " + _vbounds.y +
|
||||||
@@ -235,22 +235,25 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
if (RunAnywhere.isMacOS()) {
|
if (RunAnywhere.isMacOS()) {
|
||||||
_remgr.invalidateRegion(_nx, _ny, width, height);
|
_remgr.invalidateRegion(_nx, _ny, width, height);
|
||||||
} else {
|
} else {
|
||||||
|
_dx = dx;
|
||||||
|
_dy = dy;
|
||||||
|
|
||||||
// these are used to prevent the vertical strip from
|
// these are used to prevent the vertical strip from
|
||||||
// overlapping the horizontal strip
|
// overlapping the horizontal strip
|
||||||
int sy = _ny, shei = height;
|
int sy = _ny, shei = height;
|
||||||
|
|
||||||
// and add invalid rectangles for the exposed areas
|
// and add invalid rectangles for the exposed areas
|
||||||
if (_dy > 0) {
|
if (dy > 0) {
|
||||||
shei = Math.max(shei - _dy, 0);
|
shei = Math.max(shei - dy, 0);
|
||||||
_remgr.invalidateRegion(_nx, _ny + height - _dy, width, _dy);
|
_remgr.invalidateRegion(_nx, _ny + height - dy, width, dy);
|
||||||
} else if (_dy < 0) {
|
} else if (dy < 0) {
|
||||||
sy -= _dy;
|
sy -= dy;
|
||||||
_remgr.invalidateRegion(_nx, _ny, width, -_dy);
|
_remgr.invalidateRegion(_nx, _ny, width, -dy);
|
||||||
}
|
}
|
||||||
if (_dx > 0) {
|
if (dx > 0) {
|
||||||
_remgr.invalidateRegion(_nx + width - _dx, sy, _dx, shei);
|
_remgr.invalidateRegion(_nx + width - dx, sy, dx, shei);
|
||||||
} else if (_dx < 0) {
|
} else if (dx < 0) {
|
||||||
_remgr.invalidateRegion(_nx, sy, -_dx, shei);
|
_remgr.invalidateRegion(_nx, sy, -dx, shei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +264,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
_vbounds.x = _nx; _vbounds.y = _ny;
|
_vbounds.x = _nx; _vbounds.y = _ny;
|
||||||
|
|
||||||
// let derived classes react if they so desire
|
// let derived classes react if they so desire
|
||||||
viewLocationDidChange(_dx, _dy);
|
viewLocationDidChange(dx, dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user