mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Swap left and right handles
This commit is contained in:
parent
4defd82bed
commit
5bab8e8292
@ -46,10 +46,10 @@ class CreateAnnotation:
|
|||||||
self.state = WAITING_FOR_CLICK
|
self.state = WAITING_FOR_CLICK
|
||||||
container = self.container
|
container = self.container
|
||||||
|
|
||||||
lh = selection_handle()
|
lh = selection_handle(True)
|
||||||
self.left_handle_id = ensure_id(lh, 'handle')
|
self.left_handle_id = ensure_id(lh, 'handle')
|
||||||
container.appendChild(lh)
|
container.appendChild(lh)
|
||||||
rh = selection_handle(True)
|
rh = selection_handle(False)
|
||||||
self.right_handle_id = ensure_id(rh, 'handle')
|
self.right_handle_id = ensure_id(rh, 'handle')
|
||||||
container.appendChild(rh)
|
container.appendChild(rh)
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ class CreateAnnotation:
|
|||||||
return s, width
|
return s, width
|
||||||
|
|
||||||
style, width = do_it(lh, extents.start)
|
style, width = do_it(lh, extents.start)
|
||||||
style.left = min(max(0, extents.start.x), window.innerWidth - width // 2) + 'px'
|
style.left = (extents.start.x - width) + 'px'
|
||||||
style, width = do_it(rh, extents.end)
|
style, width = do_it(rh, extents.end)
|
||||||
style.left = (min(max(width // 2, extents.end.x), window.innerWidth) - width) + 'px'
|
style.left = extents.end.x + 'px'
|
||||||
self.state = WAITING_FOR_DRAG
|
self.state = WAITING_FOR_DRAG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user