louisstow / Pixel

Pixenomics Source
1 stars 0 forks source link

Optimize scroll #16

Closed louisstow closed 12 years ago

louisstow commented 12 years ago

Use an offscreen buffer to cache the entire board at a certain zoom. When scrolling draw the canvas.

louisstow commented 12 years ago

When zooming, draw the entire board on an offscreen canvas at a zoom level. When scrolling, draw the offscreen canvas at the zoomPos with the board width and height.

louisstow commented 12 years ago

Set the buffer width equal to zoomLevel * width same with height

louisstow commented 12 years ago

Didn't work with canvas over 8k so do a different render at high zooms.