mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 941331 - Leave a margin when double-tap zooming to an element [r=ally]
This commit is contained in:
parent
1a7bdfce00
commit
1374d27179
@ -49,6 +49,8 @@ const kReferenceDpi = 240; // standard "pixel" size used in some preferences
|
||||
|
||||
const kStateActive = 0x00000001; // :active pseudoclass for elements
|
||||
|
||||
const kZoomToElementMargin = 16; // in px
|
||||
|
||||
/*
|
||||
* getBoundingContentRect
|
||||
*
|
||||
@ -402,10 +404,18 @@ let Content = {
|
||||
|
||||
_zoomToElement: function(aElement) {
|
||||
let rect = getBoundingContentRect(aElement);
|
||||
this._inflateRect(rect, kZoomToElementMargin);
|
||||
this._zoomToRect(rect);
|
||||
this._isZoomedIn = true;
|
||||
},
|
||||
|
||||
_inflateRect: function(aRect, aMargin) {
|
||||
aRect.left -= aMargin;
|
||||
aRect.top -= aMargin;
|
||||
aRect.bottom += aMargin;
|
||||
aRect.right += aMargin;
|
||||
},
|
||||
|
||||
_zoomToRect: function (aRect) {
|
||||
let utils = Util.getWindowUtils(content);
|
||||
let viewId = utils.getViewId(content.document.documentElement);
|
||||
|
Loading…
Reference in New Issue
Block a user