Bug 720538 - Clarify and fix incorrect rect bottom calculation. r=wesj

This commit is contained in:
Kartikaya Gupta 2012-02-02 09:11:50 -05:00
Родитель 4e705231a6
Коммит e961c2ff25
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -181,11 +181,12 @@ public class PanZoomController
RectF viewableRect = mController.getViewport();
float y = viewableRect.top;
// attempt to keep zoom keep focused on the center of the viewport
float dh = viewableRect.height()*(1 - pageSize.width/viewableRect.width()); // increase in the height
float newHeight = viewableRect.height() * pageSize.width / viewableRect.width();
float dh = viewableRect.height() - newHeight; // increase in the height
final RectF r = new RectF(0.0f,
y + dh/2,
pageSize.width,
(y + pageSize.width * viewableRect.height()/viewableRect.width()));
y + dh/2 + newHeight);
mController.post(new Runnable() {
public void run() {
animatedZoomTo(r);