mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 02:47:58 +01:00
Fix marks offset issue.
This commit is contained in:
@@ -42,7 +42,7 @@ var Marks = Module("marks", {
|
|||||||
|
|
||||||
params.location = doc.documentURI.replace(/#.*/, ""),
|
params.location = doc.documentURI.replace(/#.*/, ""),
|
||||||
params.offset = buffer.scrollPosition;
|
params.offset = buffer.scrollPosition;
|
||||||
params.path = DOM(buffer.findScrollable(0, params.offset.x)).xpath;
|
params.path = DOM(buffer.findScrollable(0, false)).xpath;
|
||||||
params.timestamp = Date.now() * 1000;
|
params.timestamp = Date.now() * 1000;
|
||||||
params.equals = function (m) this.location == m.location
|
params.equals = function (m) this.location == m.location
|
||||||
&& this.offset.x == m.offset.x
|
&& this.offset.x == m.offset.x
|
||||||
|
|||||||
@@ -1482,12 +1482,12 @@ var Buffer = Module("Buffer", {
|
|||||||
*
|
*
|
||||||
* @param {Element} elem The element to scroll.
|
* @param {Element} elem The element to scroll.
|
||||||
*/
|
*/
|
||||||
getScrollPosition: function getPosition(elem) {
|
getScrollPosition: function getPosition(node) {
|
||||||
let style = DOM(elem).style;
|
let style = DOM(node.body || node).style;
|
||||||
|
|
||||||
elem = Buffer.Scrollable(elem);
|
let elem = Buffer.Scrollable(node);
|
||||||
return {
|
return {
|
||||||
x: elem.scrollLeft && elem.scrollLeft / this._exWidth(elem),
|
x: elem.scrollLeft && elem.scrollLeft / this._exWidth(node),
|
||||||
y: elem.scrollTop / parseFloat(style.lineHeight)
|
y: elem.scrollTop / parseFloat(style.lineHeight)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user