From ade2cc9abb8ca403a9ae5d1f9c145ab72ce94919 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 24 Jun 2014 18:24:02 -0700 Subject: 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 --- altosuilib/AltosUIMapView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'altosuilib/AltosUIMapView.java') 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); -- cgit v1.2.3