Skip to content

Commit 27243d2

Browse files
committed
Revert "Add the attribution text glow effect"
This reverts commit eeda372.
1 parent 835bb5c commit 27243d2

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

openmapview/src/main/kotlin/de/afarber/openmapview/AttributionOverlay.kt

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
package de.afarber.openmapview
99

1010
import android.content.Context
11-
import android.graphics.BlurMaskFilter
1211
import android.graphics.Canvas
1312
import android.graphics.Color
1413
import android.graphics.Paint
@@ -27,33 +26,21 @@ class AttributionOverlay(
2726
private var attributionText = "© OpenStreetMap contributors"
2827
private var attributionUrl = "https://www.openstreetmap.org/copyright"
2928

30-
private val density = context.resources.displayMetrics.density
31-
3229
private val textPaint =
3330
TextPaint().apply {
3431
color = Color.BLACK
35-
textSize = 12f * density
32+
textSize = 12f * context.resources.displayMetrics.density
3633
isAntiAlias = true
3734
}
3835

39-
private val glowPaint =
40-
TextPaint().apply {
41-
color = Color.WHITE
42-
textSize = 12f * density
43-
isAntiAlias = true
44-
maskFilter = BlurMaskFilter(5f * density, BlurMaskFilter.Blur.NORMAL)
45-
}
46-
4736
private val backgroundPaint =
4837
Paint().apply {
4938
color = Color.argb(180, 255, 255, 255)
5039
style = Paint.Style.FILL
5140
}
5241

5342
private var textBounds = Rect()
54-
private val padding = (4 * density).toInt()
55-
56-
var isGlowEnabled: Boolean = true
43+
private val padding = (4 * context.resources.displayMetrics.density).toInt()
5744

5845
var onAttributionClickListener: (() -> Unit)? = null
5946

@@ -109,9 +96,6 @@ class AttributionOverlay(
10996
val textX = viewWidth - textWidth - padding
11097
val textY = viewHeight - padding
11198

112-
if (isGlowEnabled) {
113-
canvas.drawText(attributionText, textX.toFloat(), textY.toFloat(), glowPaint)
114-
}
11599
canvas.drawText(attributionText, textX.toFloat(), textY.toFloat(), textPaint)
116100
}
117101

openmapview/src/main/kotlin/de/afarber/openmapview/OpenMapView.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class OpenMapView
105105
controller.setOnTileLoadedCallback {
106106
invalidate()
107107
}
108-
attributionOverlay.isGlowEnabled = uiSettings.isAttributionGlowEnabled
109108
}
110109

111110
override fun dispatchDraw(canvas: Canvas) {
@@ -114,7 +113,6 @@ class OpenMapView
114113
if (uiSettings.isZoomControlsEnabled) {
115114
zoomControlsOverlay.draw(canvas, width, height)
116115
}
117-
attributionOverlay.isGlowEnabled = uiSettings.isAttributionGlowEnabled
118116
attributionOverlay.draw(canvas, width, height)
119117
}
120118

openmapview/src/main/kotlin/de/afarber/openmapview/UiSettings.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ class UiSettings {
3838
*/
3939
var isScrollGesturesEnabledDuringRotateOrZoom: Boolean = true
4040

41-
/**
42-
* Whether the attribution text glow effect is enabled.
43-
* When true, attribution text is rendered with a white glow/halo effect.
44-
* Default is true.
45-
*/
46-
var isAttributionGlowEnabled: Boolean = true
47-
4841
/**
4942
* Whether rotate gestures are enabled.
5043
* Currently not implemented, always returns false.

0 commit comments

Comments
 (0)