You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah.. I was hoping never to see that feature request. Alright. It certainly isn't a difficult thing to do - however a significant part of the code base would be impacted.
In the non-compose one, its in TileCanvasView.kt and in drawTiles, which i already needed to change, because of our tiles having 1 pixel more on each side (so 258x258, while calucation tileSize is 256).
`
val tileScaled = (tileSize / scaleForLevel).toInt()
val imgMultiplier = (tileScaled / 256) //if zoomed out, it could be more than 256
val l = tile.col * tileScaled
val t = tile.row * tileScaled
val r = l + tileScaled.coerceAtMost(tile.bitmap.width * imgMultiplier)
val b = t + tileScaled.coerceAtMost(tile.bitmap.height * imgMultiplier)
source.set(0, 0, tileScaled.coerceAtMost(tile.bitmap.width.coerceAtMost(256)),
tileScaled.coerceAtMost(tile.bitmap.height.coerceAtMost(256)))
dest.set(l, t, r, b)
//...
canvas.drawBitmap(tile.bitmap, source, dest, paint)`
In the compose one, its in TileCanvas. Still testing around, but it looks quite good.
The tile.bitmap.width.coerceAtMost(256) is needed, because our tiles can be bigger than 256. But it should never pick them for the source.
So important was, to reduce the destination rectangle. Not sure if source is needed.
supporting rectangular tiles just like the previous library (TileView).
The text was updated successfully, but these errors were encountered: