c9 / c9.ide.imgeditor

The repository for c9.ide.imgeditor, a Cloud9 core plugin
https://c9.io/packages/c9.ide.imgeditor
MIT License
4 stars 8 forks source link

Add 800% zoom option and add toggle for zoom smoothing #2

Closed danallan closed 8 years ago

danallan commented 8 years ago

Developers wanting to look at details for small images on high-resolution screens may prefer a higher zoom range. This PR adds support for an 800% zoom and also adds a toggle to the image editor to disable (or enable) zoom smoothing.

By default, browsers that use a canvas scale option (as is used by this editor for zoom) will apply a bicubic interpolation to an image, which isn't necessarily the most accurate representation of the image. Using an annoying number of CSS properties we can disable this default behavior in browsers.

Tested and functional in Chrome 46 (should work in 41+), Safari 9 (should work in 6.1+), Firefox 42 (should work with 6+).

Should also work with IE 11, but the scale transform doesn't seem to apply, so no zoom happens in that browser. MS Edge does not support interpolation options other than their default at all.

More complete list of compatibility available here, with some motivation for the mechanism provided by this Stack Overflow post.

nightwing commented 8 years ago

Merged. Thanks!