I'm trying to disable image smoothing when zooming on a Raster, but I'm not able to. It looks like someone also asked this on stackoverflow but there are no replies. Does anyone have suggestions?
I'm trying to to set the imageSmoothingEnabled property of the canvas context to false so that the image looks pixelated, like in this example: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled which works on my browser (Google Chrome | 69.0.3497.100聽(Official Build)聽(64-bit))
Here is my codepen: https://codepen.io/akeshavan/pen/GYRZZm?editors=1010 with my attempt to do this with a paper.js Raster, but it doesn't work.
Any tips would be greatly appreciated. Thanks!
It would be necessary to get context from view.
Is it what you want? https://codepen.io/anon/pen/gBOMdJ?editors=1010
Perfect! Thank you so much!
Let's keep this open as we should probably add an API for that?
What if we add a property to Raster called Raster.smoothing = true / false, defaulting to true to preserve current behavior? This would then control the smoothing behavior at the time of rendering the raster. That way, both styles could be used and mixed within one canvas.
@lehni, I implemented Raster.smoothing in #1529.
So, @akeshavan, once this change will be merged, you'll just have to do:
raster.smoothing = false;
@sasensi thanks for taking time to do this! I will make time to review it properly soon. There will some minor changes, mostly to align things with internal architecture and also change tracking to take note of the need for redraws, but nothing major.
awesome, thanks @sasensi and @lehni !
Thanks to @sasensi , this will be part of the next release! 馃帀
Speaking of which: @sapics and @sasensi, could you help me with updating the CHANGELOG? You can look at its content to see how it should relate to the changes we've added since the last release.
Most helpful comment
Thanks to @sasensi , this will be part of the next release! 馃帀
Speaking of which: @sapics and @sasensi, could you help me with updating the CHANGELOG? You can look at its content to see how it should relate to the changes we've added since the last release.