Skip to content

Commit

Permalink
Fix on || New gravity -> CenterInside- 🚀 ||
Browse files Browse the repository at this point in the history
  • Loading branch information
AsynctaskCoffee committed Dec 11, 2020
1 parent e551095 commit 5f2ddff
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,7 @@ private void updateTextureViewSize(int viewWidth, int viewHeight) {
if (VIDEO_GRAVITY == 4) {
pivotPointX = 0;
pivotPointY = viewHeight / 2;

if (mVideoWidth > viewWidth && mVideoHeight > viewHeight) {
scaleX = mVideoWidth / viewWidth;
scaleY = mVideoHeight / viewHeight;
} else if (mVideoWidth < viewWidth && mVideoHeight < viewHeight) {
scaleY = viewWidth / mVideoWidth;
scaleX = viewHeight / mVideoHeight;
}

scaleY = scaleY / 2;
scaleX = scaleX / 2;

scaleY = (viewWidth / mVideoWidth) / (viewHeight / mVideoHeight);
matrix.setScale(scaleX, scaleY, pivotPointX, pivotPointY);
} else {
if (mVideoWidth > viewWidth && mVideoHeight > viewHeight) {
Expand Down

0 comments on commit 5f2ddff

Please sign in to comment.