Releases: timmywil/panzoom
Account for text-align, add back pointer events
- In 3.1.0 (see 20aa64a), I greatly simplified the
contain
logic. The complexity had piled up to the point where I didn't even understand it all. Unfortunately, I made a significant error and broke all panzoom elements that weren'tdisplay: inline
withtext-align: center
–like the ones in the demo page. This patch adds back the logic necessary to contain elements that are not already centered. Note: Panzoom does not supporttext-align: right
. Just set it toleft
orcenter
. - I had also removed support for pointer events, but I broke panzoom for devices that have both a mouse and touch support (for instance, some Windows laptops). While Pointer Events can be problematic to support in IE10, IE11, and Edge, I was able to work around all of the problems that have been reported so far. Pointer Event support is now better than ever!
Enabling transitions for SVG elements where supported
IE9-11 and Edge 13-14+ do not respect transform values set through CSS. This makes it impossible to use CSS transitions on SVG elements in those browsers.
Nevertheless, why not enable them in the browsers where it works? Chrome, Firefox, and Safari do this just fine.
jQuery 3.0 support, new options, shave 300 gzipped bytes
- jquery.panzoom 3.0+ adds support for jQuery 3.0 (version number parity is coincidental). This included removing the jquery.event.pointertouch plugin–it broke since the event extension API had changed. The result was mainly that the
originalEvent
property got used more often. - I dropped support for pointer events because of pointer event issues in IE11. They weren't really adding anything and users were disabling pointer event support through hacks.
New features
contain: 'automatic'
option. Greatly simplifiedcontain
option logic in the process.disableXAxis
anddisableYAxis
options.panOnlyWhenZoomed
optionexponential
zoom option - Zoom increments exponentially rather than linearly. This is somewhat experimental, but still enabled by default. Linear incrementation was just too slow.
Notable bug fixes
- Fixed an issue where rotations with negative values were getting reset to 0.
- Moved
backface-visibility:hidden
style to parent to avoid blur on SVG images, but still promote the animation to its own composite layer for optimal performance. - IE11 had a false positive on a feature test for the
input
event. IE11 now uses thechange
event fallback.
SVG: revert using styles to set transforms
Settings transform styles is not supported in IE. Unfortunately, this means that transitions are not supported for SVG, but transforms work again in all browsers.
See #86.
API change with `focal` option
By default, whenever the focal option was used it disabled animations. It was meant to be used with pinch zooming and mousewheel zooming, which should not animate. However, I've seen some cases where focal has been used and animating is necessary.
Migrating
If you've been using the focal option with the mousewheel, make sure to set animate to false.
$panzoom.parent().on('mousewheel.focal', function( e ) {
e.preventDefault();
var delta = e.delta || e.originalEvent.wheelDelta;
var zoomOut = delta ? delta < 0 : e.originalEvent.deltaY > 0;
$panzoom.panzoom('zoom', zoomOut, {
increment: 0.1,
focal: e,
animate: false
});
});
Aside from this change, the latest updates to panzoom are also really exciting.
- Improved performance across the board. Every panzoom element now has its own compositor layer.
- Improved support for CommonJS loading.
Pointertouch and absolute scales
Added Pointer Event Support
1.9.0 Release 1.9.0
Focal point zooming fix
This release fixes an issue with focal point zooming when the panzoom element's dimensions differed than its parent.
Fixed an issue with inverted containment
When the panzoom element was larger than the container, inverted containment was off.
Added dValue option to zoom.
This option isn't documented, but it's there for super users. An explanation of this option is available in the source.