mirror of
https://github.com/xdsopl/robot36.git
synced 2025-12-06 07:12:07 +01:00
when using int scaling, set scaling to at least 1x
This commit is contained in:
parent
28aed20659
commit
272deee15f
|
|
@ -265,8 +265,8 @@ public class ImageView extends SurfaceView implements SurfaceHolder.Callback {
|
|||
sy = (float)canvasWidth / imageWidth;
|
||||
}
|
||||
if (intScale) {
|
||||
sx = (float)Math.floor(sx);
|
||||
sy = (float)Math.floor(sy);
|
||||
sx = (float)Math.max(1, Math.floor(sx));
|
||||
sy = (float)Math.max(1, Math.floor(sy));
|
||||
}
|
||||
float px = (canvasWidth - sx * bitmap.getWidth()) / 2.0f;
|
||||
float py = (canvasHeight - sy * bitmap.getHeight()) / 2.0f;
|
||||
|
|
|
|||
Loading…
Reference in a new issue