|
201 | 201 | // console.debug("****** browser IS", browser.getEngineName()); |
202 | 202 | if (browser.getEngineName() == 'Gecko') { |
203 | 203 | // If the agent is FF then we need to use the moz-transform |
204 | | - // AND not put in the zoom |
| 204 | + // AND not put in the zoom |
205 | 205 | this.zoomContainer.find(".annotated_page").css({ |
206 | 206 | '-moz-transform' : ('scale(' + zoom + ')'), |
207 | 207 | '-moz-transform-origin' : 'top left' |
|
432 | 432 | stop : function(e, ui) { |
433 | 433 | var offset = $box.offset(); |
434 | 434 |
|
435 | | - let x = 0; |
436 | | - let y = 0; |
437 | | - const browser = Bowser.getParser(window.navigator.userAgent); |
438 | | - if (browser.getEngineName() == 'Blink') { |
439 | | - x = offset.left - $(document).scrollLeft() - $("#target-image").offset().left; |
440 | | - y = offset.top - $(document).scrollTop() - $("#target-image").offset().top; |
441 | | - } else { |
442 | | - x = (offset.left - $(document).scrollLeft() - $("#target-image").offset().left) / toolbarLayout.currentZoom; |
443 | | - y = (offset.top - $(document).scrollTop() - $("#target-image").offset().top) / toolbarLayout.currentZoom; |
444 | | - } |
445 | | - |
446 | | - |
| 435 | + let x = (offset.left - $(document).scrollLeft() - $("#target-image").offset().left) / toolbarLayout.currentZoom; |
| 436 | + let y = (offset.top - $(document).scrollTop() - $("#target-image").offset().top) / toolbarLayout.currentZoom; |
447 | 437 | var width = $box.width(); |
448 | 438 | var height = $box.height(); |
449 | 439 |
|
|
505 | 495 | } |
506 | 496 | }); |
507 | 497 | }, |
508 | | - start: function( event, ui ) { |
509 | | - const browser = Bowser.getParser(window.navigator.userAgent); |
510 | | - if (browser.getEngineName() == 'Blink') { |
511 | | - var x = $box.position().left; // - ($(document).scrollLeft() + $("#target-image").offset().left); |
512 | | - var y = $box.position().top - ($(document).scrollTop() + $("#target-image").offset().top); |
513 | | - ui.position = { left: x, top: y}; |
514 | | - } |
515 | | - }, |
516 | 498 | drag: function( event, ui ) { |
517 | | - var zoom = toolbarLayout.currentZoom; //getComputedStyle(this).zoom; |
518 | | - const browser = Bowser.getParser(window.navigator.userAgent); |
519 | | - if (browser.getEngineName() == 'Blink') { |
520 | | - var x = ui.offset.left - $(document).scrollLeft() - $("#target-image").offset().left; // / zoom; // / zoom; |
521 | | - var y = ui.offset.top - $(document).scrollTop() - $("#target-image").offset().top; // / zoom; // / zoom; |
522 | | - |
523 | | - ui.position.left = x; |
524 | | - ui.position.top = y; |
525 | | - } else { |
526 | | - var x = ui.position.left / zoom; |
527 | | - var y = ui.position.top / zoom; |
528 | | - ui.position.left = x; |
529 | | - ui.position.top = y; |
530 | | - } |
| 499 | + var zoom = toolbarLayout.currentZoom; |
| 500 | + var x = ui.position.left / zoom; |
| 501 | + var y = ui.position.top / zoom; |
| 502 | + ui.position.left = x; |
| 503 | + ui.position.top = y; |
531 | 504 | }, |
532 | 505 | stop : function(e, ui) { |
533 | 506 | var zoom = toolbarLayout.currentZoom; |
|
0 commit comments