diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-24 18:24:02 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-24 18:25:18 -0700 |
commit | ade2cc9abb8ca403a9ae5d1f9c145ab72ce94919 (patch) | |
tree | a049e59c6b97021e8f6c3305b5dc7f87f9963d26 /altosuilib/AltosUIMapView.java | |
parent | 97269bb90c1602a1f8c54fc7b6c34383a0370621 (diff) |
altosuilib: Make map cache size configurable
Systems with sufficient memory can get smoother map scrolling by
making the cache larger. Would be nice to do this automatically?
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIMapView.java')
-rw-r--r-- | altosuilib/AltosUIMapView.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/altosuilib/AltosUIMapView.java b/altosuilib/AltosUIMapView.java index 1abd1731..34a85f52 100644 --- a/altosuilib/AltosUIMapView.java +++ b/altosuilib/AltosUIMapView.java @@ -370,7 +370,7 @@ public class AltosUIMapView extends Component implements MouseMotionListener, Mo for (Point point : to_remove) tiles.remove(point); - cache.set_cache_size(((lower_right.y - upper_left.y) / px_size + 1) * ((lower_right.x - upper_left.x) / px_size + 1)); + cache.set_cache_size((getWidth() / px_size + 2) * (getHeight() / px_size + 2)); for (int y = upper_left.y; y <= lower_right.y; y += px_size) { for (int x = upper_left.x; x <= lower_right.x; x += px_size) { Point point = new Point(x, y); |