(active = null, gamepad = false, fromSwitch = false)
| 2768 | |
| 2769 | //Turn the magnifying glass on and off |
| 2770 | function activeMagnifyingGlass(active = null, gamepad = false, fromSwitch = false) |
| 2771 | { |
| 2772 | // Toggle magnifying glass |
| 2773 | if(active === null) active = !config.readingMagnifyingGlass; |
| 2774 | |
| 2775 | if(active) |
| 2776 | { |
| 2777 | storage.updateVar('config', 'readingMagnifyingGlass', true); |
| 2778 | render.setMagnifyingGlassStatus(config.readingMagnifyingGlassZoom, doublePage.active()); |
| 2779 | |
| 2780 | if(gamepad) |
| 2781 | { |
| 2782 | let contentRight = template._contentRight(); |
| 2783 | let rect = contentRight.getBoundingClientRect(); |
| 2784 | |
| 2785 | let pageX = (rect.width / 2) + rect.left; |
| 2786 | let pageY = (rect.height / 2) + rect.top; |
| 2787 | |
| 2788 | magnifyingGlassControl(1, {pageX: pageX, pageY: pageY, originalEvent: {touches: false}}); |
| 2789 | } |
| 2790 | else if(pointermoveEvent && !fromSwitch) |
| 2791 | { |
| 2792 | magnifyingGlassControl(1, pointermoveEvent); |
| 2793 | } |
| 2794 | } |
| 2795 | else |
| 2796 | { |
| 2797 | storage.updateVar('config', 'readingMagnifyingGlass', false); |
| 2798 | magnifyingGlassControl(0); |
| 2799 | render.setMagnifyingGlassStatus(false); |
| 2800 | } |
| 2801 | } |
| 2802 | |
| 2803 | //Magnifying glass settings |
| 2804 | function changeMagnifyingGlass(mode, value, save) |
nothing calls this directly
no test coverage detected