bug 476729: Calculate a viewing rect relative to the canvas

This commit is contained in:
Taras Glek 2009-02-04 16:38:43 -08:00
parent 62b48b4f47
commit 9fdc0f3080
2 changed files with 4 additions and 3 deletions

View File

@ -229,7 +229,7 @@ CanvasBrowser.prototype = {
viewportHandler: function(bounds, boundsSizeChanged) {
let pageBounds = bounds.clone();
let visibleBounds = ws.viewingRect;
let visibleBounds = ws.viewportVisibleRect;
pageBounds.top = Math.floor(this._screenToPage(bounds.top));
pageBounds.left = Math.floor(this._screenToPage(bounds.left));
pageBounds.bottom = Math.ceil(this._screenToPage(bounds.bottom));

View File

@ -469,8 +469,9 @@ WidgetStack.prototype = {
state.widget.setAttribute("top", y);
},
get viewingRect() {
return this._viewingRect.clone();
// we're relying on viewportBounds and viewingRect having the same origin
get viewportVisibleRect () {
return this._viewportBounds.intersect(this._viewingRect)
},
// isWidgetVisible: return true if any portion of widget with id wid is