We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc215a2 commit 8524af7Copy full SHA for 8524af7
plugin/zoom-js/zoom.js
@@ -5,9 +5,21 @@
5
document.querySelector( '.reveal' ).addEventListener( 'mousedown', function( event ) {
6
var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key';
7
8
+ var zoomPadding = 20;
9
+ var revealScale = Reveal.getScale();
10
+
11
if( event[ modifier ] && isEnabled ) {
12
event.preventDefault();
- zoom.to({ element: event.target, pan: false });
13
14
+ var bounds = event.target.getBoundingClientRect();
15
16
+ zoom.to({
17
+ x: ( bounds.left * revealScale ) - zoomPadding,
18
+ y: ( bounds.top * revealScale ) - zoomPadding,
19
+ width: ( bounds.width * revealScale ) + ( zoomPadding * 2 ),
20
+ height: ( bounds.height * revealScale ) + ( zoomPadding * 2 ),
21
+ pan: false
22
+ });
23
}
24
} );
25
0 commit comments