Commit bd5065f1 authored by Mehran Mahmoudi's avatar Mehran Mahmoudi Committed by Commit Bot

[Paint Preview] Fix issue with orientation change

This fixes the issue where the player won't paint anything after
orientatin is changes from portrait to landscape.

Bug: 1113322
Change-Id: I3cc48afb7ea869512b3862e0f8127e6f3ed8f797
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339757
Commit-Queue: Mehran Mahmoudi <mahmoudi@chromium.org>
Reviewed-by: default avatarFred Mello <fredmello@chromium.org>
Reviewed-by: default avatarMehran Mahmoudi <mahmoudi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795903}
parent c15e7db8
......@@ -52,12 +52,12 @@ class PlayerFrameBitmapPainter {
if (mTileSize.getWidth() <= 0 || mTileSize.getHeight() <= 0) return;
final int rowStart = mViewPort.top / mTileSize.getHeight();
final int rowEnd = (int) Math.ceil((double) mViewPort.bottom / mTileSize.getHeight());
int rowEnd = (int) Math.ceil((double) mViewPort.bottom / mTileSize.getHeight());
final int colStart = mViewPort.left / mTileSize.getWidth();
final int colEnd = (int) Math.ceil((double) mViewPort.right / mTileSize.getWidth());
if (rowEnd > mBitmapMatrix.length || colEnd > mBitmapMatrix[rowEnd - 1].length) {
return;
}
int colEnd = (int) Math.ceil((double) mViewPort.right / mTileSize.getWidth());
rowEnd = Math.min(rowEnd, mBitmapMatrix.length);
colEnd = Math.min(colEnd, rowEnd > 1 ? mBitmapMatrix[rowEnd - 1].length : 0);
for (int row = rowStart; row < rowEnd; row++) {
for (int col = colStart; col < colEnd; col++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment