I have worked on improving performance when panning and zooming inside canvas files.
Previously, the performance in canvas files containing high resolution images was pretty bad. It was laggy when panning and zooming and especially also when selecting object using marquee-selector. This has now become butter-smooth!
I improved canvas performance by using LOD (meaning _Level of detail_) to give each canvas image only as much pixel detail as its current screen size needs:
- Offscreen: no active bitmap in the object view.
- Near viewport: low-detail 512 px preview.
- Visible: higher-detail rendition based on on-screen size and Retina scale.
- Zoom in: request a higher LOD if the current rendition would become visibly soft.
When an image object is farther than half a viewport outside the screen, it is not rendering the bitmapped data. It's still showing a box for where the image should be (with the correct dimensions), but it's not using memory on actually rendering the image before it's almost inside the viewport.
This part of rendering images before they are inside viewport is still a bit buggy. Sometimes images will not render unless the user zooms in a bit (idk why, still debugging ๐จโ๐ป).
But the canvas has become so much smoother than when it was built in #SwiftUI (I replaced it all with #AppKit recently). #dev
Previously, the performance in canvas files containing high resolution images was pretty bad. It was laggy when panning and zooming and especially also when selecting object using marquee-selector. This has now become butter-smooth!
I improved canvas performance by using LOD (meaning _Level of detail_) to give each canvas image only as much pixel detail as its current screen size needs:
- Offscreen: no active bitmap in the object view.
- Near viewport: low-detail 512 px preview.
- Visible: higher-detail rendition based on on-screen size and Retina scale.
- Zoom in: request a higher LOD if the current rendition would become visibly soft.
When an image object is farther than half a viewport outside the screen, it is not rendering the bitmapped data. It's still showing a box for where the image should be (with the correct dimensions), but it's not using memory on actually rendering the image before it's almost inside the viewport.
This part of rendering images before they are inside viewport is still a bit buggy. Sometimes images will not render unless the user zooms in a bit (idk why, still debugging ๐จโ๐ป).
But the canvas has become so much smoother than when it was built in #SwiftUI (I replaced it all with #AppKit recently). #dev