diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-08-03 16:39:46 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-08-03 16:40:05 +0200 |
| commit | 30194eb7d4dfd083ae7e456342203cc6d9d9cf81 (patch) | |
| tree | f0b419fce90a8e837a88b0c562af6cdca07ee4d7 /main/src/cgeo/geocaching/maps/CGeoMap.java | |
| parent | 2cd573148aba544b202bc046851e79324b39f494 (diff) | |
| download | cgeo-30194eb7d4dfd083ae7e456342203cc6d9d9cf81.zip cgeo-30194eb7d4dfd083ae7e456342203cc6d9d9cf81.tar.gz cgeo-30194eb7d4dfd083ae7e456342203cc6d9d9cf81.tar.bz2 | |
Move functions to count visible points in viewport class
Diffstat (limited to 'main/src/cgeo/geocaching/maps/CGeoMap.java')
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 2ca0cfd..e96c246 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -373,21 +373,7 @@ public class CGeoMap extends AbstractMap implements ViewFactory { } protected void countVisibleCaches() { - final List<Geocache> protectedCaches = caches.getAsList(); - - int count = 0; - if (!protectedCaches.isEmpty()) { - final Viewport viewport = mapView.getViewport(); - - for (final Geocache cache : protectedCaches) { - if (cache != null && cache.getCoords() != null) { - if (viewport.contains(cache)) { - count++; - } - } - } - } - cachesCnt = count; + cachesCnt = mapView.getViewport().count(caches.getAsList()); } @Override |
