Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit b4d7543

Browse files
committed
Fix rounding; sometimes image zoomed from 2nd click
1 parent 9b6d8e6 commit b4d7543

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

dist/jquery.fancybox.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==================================================
2-
// fancyBox v3.1.22
2+
// fancyBox v3.1.23
33
//
44
// Licensed GPLv3 for open source use
55
// or fancyBox Commercial License for commercial use
@@ -2092,8 +2092,8 @@
20922092
if ( effect === 'zoom' ) {
20932093
end = self.getFitPos( slide );
20942094

2095-
end.scaleX = Math.round( (end.width / start.width) * 100 ) / 100;
2096-
end.scaleY = Math.round( (end.height / start.height) * 100 ) / 100;
2095+
end.scaleX = end.width / start.width;
2096+
end.scaleY = end.height / start.height;
20972097

20982098
delete end.width;
20992099
delete end.height;
@@ -2629,7 +2629,7 @@
26292629

26302630
$.fancybox = {
26312631

2632-
version : "3.1.22",
2632+
version : "3.1.23",
26332633
defaults : defaults,
26342634

26352635

@@ -2855,8 +2855,8 @@
28552855
if ( to.scaleX !== undefined && to.scaleY !== undefined ) {
28562856
$el.css( 'transition-duration', '0ms' );
28572857

2858-
to.width = $el.width() * to.scaleX;
2859-
to.height = $el.height() * to.scaleY;
2858+
to.width = Math.round( $el.width() * to.scaleX );
2859+
to.height = Math.round( $el.height() * to.scaleY );
28602860

28612861
to.scaleX = 1;
28622862
to.scaleY = 1;

dist/jquery.fancybox.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@fancyapps/fancybox",
33
"description": "Touch enabled, responsive and fully customizable jQuery lightbox script",
4-
"version": "3.1.22",
4+
"version": "3.1.23",
55
"homepage": "http://fancyapps.com/fancybox/",
66
"main": "./dist/jquery.fancybox.min.js",
77
"author": "fancyApps",

src/js/core.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,8 +2082,8 @@
20822082
if ( effect === 'zoom' ) {
20832083
end = self.getFitPos( slide );
20842084

2085-
end.scaleX = Math.round( (end.width / start.width) * 100 ) / 100;
2086-
end.scaleY = Math.round( (end.height / start.height) * 100 ) / 100;
2085+
end.scaleX = end.width / start.width;
2086+
end.scaleY = end.height / start.height;
20872087

20882088
delete end.width;
20892089
delete end.height;
@@ -2845,8 +2845,8 @@
28452845
if ( to.scaleX !== undefined && to.scaleY !== undefined ) {
28462846
$el.css( 'transition-duration', '0ms' );
28472847

2848-
to.width = $el.width() * to.scaleX;
2849-
to.height = $el.height() * to.scaleY;
2848+
to.width = Math.round( $el.width() * to.scaleX );
2849+
to.height = Math.round( $el.height() * to.scaleY );
28502850

28512851
to.scaleX = 1;
28522852
to.scaleY = 1;

0 commit comments

Comments
 (0)