Androidで長方形のビットマップをドラッグすると、これを使用してビットマップを描画します
//short cut code, after getting the new position from event
int x = event.x;
int y = event.y;
canvas.drawRect(bitmap, x - bitmapwidth/2,y-bitmapheight/2,null)
ただし、これには問題があります。幅の広いビットマップがあり、ビットマップの左側の部分に触れた場合、ビットマップはイベントからの新しいタッチ座標を中心に配置されます。
ビットマップをドラッグし、ドラッグ ポイントに相対的な位置を維持する方法はありますか? マウスドラッグの動作と同じように?
ありがとう