move more code to Graphics

This commit is contained in:
Zutatensuppe 2020-11-09 20:30:37 +01:00
parent 73872ebb6f
commit 1605fdfc99
2 changed files with 27 additions and 21 deletions

View file

@ -212,6 +212,16 @@ function mapBitmapToAdapter(
}
}
function drawBitmap(adapter, bitmap, pos) {
const rect = bitmap.getBoundingRect()
mapBitmapToAdapter(
bitmap,
rect,
adapter,
rect.moved(pos.x, pos.y)
)
}
export default {
createCanvas,
dataToBitmap,
@ -225,4 +235,5 @@ export default {
fillBitmapCapped,
mapBitmapToAdapter,
mapBitmapToAdapterCapped,
drawBitmap,
}