mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove unused code
This commit is contained in:
parent
534d06eb4d
commit
d96b798d45
@ -253,30 +253,6 @@ def scroll_to_fraction(frac):
|
||||
scroll_to_xpos(xpos)
|
||||
|
||||
|
||||
def column_location(elem):
|
||||
# Return the location of elem relative to its containing column.
|
||||
# WARNING: This method may cause the viewport to scroll (to workaround
|
||||
# a bug in WebKit).
|
||||
br = elem.getBoundingClientRect()
|
||||
# Because of a bug in WebKit's getBoundingClientRect() in column
|
||||
# mode, this position can be inaccurate, see
|
||||
# https://bugs.launchpad.net/calibre/+bug/1202390 for a test case.
|
||||
# The usual symptom of the inaccuracy is br.top is highly negative.
|
||||
if br.top < -100:
|
||||
# We have to actually scroll the element into view to get its
|
||||
# position
|
||||
elem.scrollIntoView()
|
||||
left, top = viewport_to_document(elem.scrollLeft, elem.scrollTop, elem.ownerDocument)
|
||||
else:
|
||||
left, top = viewport_to_document(br.left, br.top, elem.ownerDocument)
|
||||
c = column_at(left)
|
||||
width = min(br.right, (c+1)*col_and_gap) - br.left
|
||||
if br.bottom < br.top:
|
||||
br.bottom = scroll_viewport.height()
|
||||
height = min(br.bottom, scroll_viewport.height()) - br.top
|
||||
left -= c * col_and_gap
|
||||
return {'column':c, 'left':left, 'top':top, 'width':width, 'height':height}
|
||||
|
||||
def column_boundaries():
|
||||
# Return the column numbers at the left edge and after the right edge
|
||||
# of the viewport
|
||||
|
Loading…
x
Reference in New Issue
Block a user