Fix wrong split percentage after split layout been pushed up

The task thumbnails of splitting task might not start with (0, 0), like
the case when IME panel pushing up split layout. Updated to consider
different start position while calculating split percentage.

Fix: 218704243
Test: enter split in portrait, toggle on IME panel, observed task
      thumbnails been placed properly after swiped up to overview.
Change-Id: I5b0d9710b56e9d77b86369c7fff4bc3ca75d9c7e
This commit is contained in:
Jerry Chang
2022-03-30 11:20:28 +00:00
parent db2c726560
commit f5d90b9ec2

View File

@@ -154,10 +154,12 @@ public final class SplitConfigurationOptions {
}
}
leftTaskPercent = this.leftTopBounds.width() / (float) rightBottomBounds.right;
topTaskPercent = this.leftTopBounds.height() / (float) rightBottomBounds.bottom;
dividerWidthPercent = visualDividerBounds.width() / (float) rightBottomBounds.right;
dividerHeightPercent = visualDividerBounds.height() / (float) rightBottomBounds.bottom;
float totalWidth = rightBottomBounds.right - leftTopBounds.left;
float totalHeight = rightBottomBounds.bottom - leftTopBounds.top;
leftTaskPercent = leftTopBounds.width() / totalWidth;
topTaskPercent = leftTopBounds.height() / totalHeight;
dividerWidthPercent = visualDividerBounds.width() / totalWidth;
dividerHeightPercent = visualDividerBounds.height() / totalHeight;
}
}