From 790cf9f36e490d81d0e8c6146a2bf8566a98bddc Mon Sep 17 00:00:00 2001 From: Andreas Sinz Date: Thu, 6 Jul 2017 20:51:43 +0200 Subject: [PATCH] Only draw Raster Items, when they are visible --- .../java/org/blitzortung/android/map/overlay/RasterShape.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/blitzortung/android/map/overlay/RasterShape.kt b/app/src/main/java/org/blitzortung/android/map/overlay/RasterShape.kt index 14b914a5..9ec3fe0d 100644 --- a/app/src/main/java/org/blitzortung/android/map/overlay/RasterShape.kt +++ b/app/src/main/java/org/blitzortung/android/map/overlay/RasterShape.kt @@ -38,6 +38,11 @@ class RasterShape : Shape() { } override fun draw(canvas: Canvas, paint: Paint) { + //Only draw visible Raster-Items + if(canvas.quickReject(rect, Canvas.EdgeType.BW)){ + return + } + paint.color = color paint.alpha = alpha canvas.drawRect(rect, paint)