mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-16 11:41:19 +01:00
make sure the imported bitmap is centered
This commit is contained in:
parent
6c2dc3ca63
commit
18019315e2
@ -116,7 +116,9 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
|||||||
super.onDraw(canvas)
|
super.onDraw(canvas)
|
||||||
|
|
||||||
if (mBackgroundBitmap != null) {
|
if (mBackgroundBitmap != null) {
|
||||||
canvas.drawBitmap(mBackgroundBitmap, 0f, 0f, null)
|
val left = (width - mBackgroundBitmap!!.width) / 2
|
||||||
|
val top = (height - mBackgroundBitmap!!.height) / 2
|
||||||
|
canvas.drawBitmap(mBackgroundBitmap, left.toFloat(), top.toFloat(), null)
|
||||||
}
|
}
|
||||||
|
|
||||||
for ((key, value) in mPaths) {
|
for ((key, value) in mPaths) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user