Drawing text at ground station position now

pull/30/head
Arty Bishop 2019-12-16 08:08:43 +00:00
rodzic 505c98b156
commit 8fe55b78af
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -143,6 +143,12 @@ class WorldMapFragment : Fragment() {
style = Paint.Style.FILL
strokeWidth = scale
}
private val homeTxtPaint = Paint().apply {
isAntiAlias = true
color = resources.getColor(R.color.themeAccent, mainActivity.theme)
style = Paint.Style.FILL
textSize = 16f
}
private val scale = resources.displayMetrics.density
private val gsp = viewModel.gsp.value!!
@ -217,6 +223,7 @@ class WorldMapFragment : Fragment() {
val cx = frameWidth / 360f * gsp.longitude.toFloat()
val cy = frameHeight / 180f * gsp.latitude.toFloat() * -1
canvas.drawCircle(cx, cy, scale * 2, homeLocPaint)
canvas.drawText("GSP", cx-homeTxtPaint.textSize, cy-homeTxtPaint.textSize, homeTxtPaint)
}
private fun getDateFor(value: Long): Date {