mirror of
https://github.com/jamessanford/kegs.git
synced 2024-06-13 23:29:28 +00:00
Fix? off-by-one error in GL view.
This commit is contained in:
parent
fd3c79cdca
commit
045e601c4a
|
@ -93,13 +93,13 @@ class KegsRenderer implements GLSurfaceView.Renderer {
|
|||
// Show as much of the border as we can.
|
||||
int leftover = (30+400+32) - mHeightUnscaled;
|
||||
leftover /= 2;
|
||||
gl.glOrthof(0.0f, (float)mWidth, (50.0f+leftover) * mScaleY, (50.0f+leftover+mHeightUnscaled) * mScaleY, 0.0f, 1.0f);
|
||||
gl.glOrthof(1.0f, (float)mWidth+1.0f, (50.0f+leftover) * mScaleY, (50.0f+leftover+mHeightUnscaled) * mScaleY, 0.0f, 1.0f);
|
||||
} else {
|
||||
// Just show the 400 pixels.
|
||||
gl.glOrthof(0.0f, (float)mWidth, (50.0f+30.0f) * mScaleY, (50.0f+30.0f+400.0f) * mScaleY, 0.0f, 1.0f);
|
||||
gl.glOrthof(1.0f, (float)mWidth+1.0f, (50.0f+30.0f) * mScaleY, (50.0f+30.0f+400.0f) * mScaleY, 0.0f, 1.0f);
|
||||
}
|
||||
} else {
|
||||
gl.glOrthof(0.0f, (float)mWidth, 50.0f * mScaleY, (50.0f+30.0f+400.0f+32.0f) * mScaleY, 0.0f, 1.0f);
|
||||
gl.glOrthof(1.0f, (float)mWidth+1.0f, 50.0f * mScaleY, (50.0f+30.0f+400.0f+32.0f) * mScaleY, 0.0f, 1.0f);
|
||||
}
|
||||
gl.glMatrixMode(GL10.GL_MODELVIEW);
|
||||
gl.glLoadIdentity();
|
||||
|
@ -224,6 +224,6 @@ class KegsRenderer implements GLSurfaceView.Renderer {
|
|||
mCropBorder = bitmapSize.doCropBorder();
|
||||
mScaled = bitmapSize.isScaled();
|
||||
mSizeChange = true;
|
||||
Log.i("kegs", "screen size " + mWidth + "x" + mHeight + " " + mScaleX + ":" + mScaleY + " crop=" + mCropBorder + " unscaledY=" + mHeightUnscaled);
|
||||
Log.i("kegs", "screen size " + (float)mWidth + "x" + mHeight + " " + mScaleX + ":" + mScaleY + " crop=" + mCropBorder + " unscaledY=" + mHeightUnscaled);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user