MCPcopy
hub / github.com/ollm/OpenComic / activeMagnifyingGlass

Function activeMagnifyingGlass

scripts/reading.js:2770–2801  ·  view source on GitHub ↗
(active = null, gamepad = false, fromSwitch = false)

Source from the content-addressed store, hash-verified

2768
2769//Turn the magnifying glass on and off
2770function 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
2804function changeMagnifyingGlass(mode, value, save)

Callers

nothing calls this directly

Calls 1

magnifyingGlassControlFunction · 0.85

Tested by

no test coverage detected