Skip to content

Commit 18bbd10

Browse files
author
Tien Dzung
committed
fix adjustImageScaling (cats-oss#502)
1 parent 2d7d61d commit 18bbd10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/src/main/java/jp/co/cyberagent/android/gpuimage/GPUImageRenderer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ private void adjustImageScaling() {
301301
addDistance(textureCords[6], distHorizontal), addDistance(textureCords[7], distVertical),
302302
};
303303
} else {
304+
if (rotation == Rotation.ROTATION_270 || rotation == Rotation.ROTATION_90) {
305+
ratioWidth = ratioWidth + ratioHeight;
306+
ratioHeight = ratioWidth - ratioHeight;
307+
ratioWidth = ratioWidth - ratioHeight;
308+
}
304309
cube = new float[]{
305310
CUBE[0] / ratioHeight, CUBE[1] / ratioWidth,
306311
CUBE[2] / ratioHeight, CUBE[3] / ratioWidth,

0 commit comments

Comments
 (0)