mirror of
https://github.com/jamessanford/kegs.git
synced 2024-09-27 08:54:33 +00:00
More accurate scaling with GL renderer. The software renderer likely needs an adjustment now.
This commit is contained in:
parent
10c52151f7
commit
aff9838674
@ -43,7 +43,7 @@ class BitmapSize {
|
||||
if (!doCropBorder()) {
|
||||
return (int)(Const.A2Height * mScaleFactorY);
|
||||
} else {
|
||||
return (int)((Const.A2Height - 32) * mScaleFactorY);
|
||||
return (int)((Const.A2Height - 32 - 30) * mScaleFactorY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,12 +88,9 @@ class KegsRenderer implements GLSurfaceView.Renderer {
|
||||
gl.glLoadIdentity();
|
||||
// 50.0f is 512-(400+32+30) (the distance from the bottom of the texture to our actual bitmap)
|
||||
float cropBorder = 50.0f;
|
||||
float fudge = 0.0f;
|
||||
if (mCropBorder > 0.0f) {
|
||||
cropBorder += mCropBorder;
|
||||
fudge = 14.0f; // Bug workaround to view the entire image better...
|
||||
}
|
||||
gl.glOrthof(0.0f, (float)mWidth, cropBorder, mHeight + cropBorder + fudge, 0.0f, 1.0f);
|
||||
cropBorder *= mScaleY;
|
||||
cropBorder += mCropBorder * mScaleY; // likely zero
|
||||
gl.glOrthof(0.0f, (float)mWidth, cropBorder, mHeight + cropBorder, 0.0f, 1.0f);
|
||||
gl.glMatrixMode(GL10.GL_MODELVIEW);
|
||||
gl.glLoadIdentity();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user