diff --git a/src/calibre/ebooks/oeb/display/cfi.coffee b/src/calibre/ebooks/oeb/display/cfi.coffee index 7afaf5523d..a03dd49c0a 100644 --- a/src/calibre/ebooks/oeb/display/cfi.coffee +++ b/src/calibre/ebooks/oeb/display/cfi.coffee @@ -76,7 +76,9 @@ viewport_to_document = (x, y, doc) -> # {{{ # We are in a frame node = win.frameElement rect = node.getBoundingClientRect() - return viewport_to_document(rect.left, rect.top, node.ownerDocument) + [vx, vy] = viewport_to_document(rect.left, rect.top, node.ownerDocument) + x += vx + y += vy return [x, y] # }}}