Minor version update
This release introduces new functionality while remaining interface-backwards-compatible with prior v3.. releases.
Contents
1. Removed off-screen blitting support
This feature was off by default. Turning it on produced no measurable performance gain (in Chrome at least). We may add it back later if we can realize a benefit.
- Removed
grid.properties.useBitBlit
,grid.canvas.bc
, andgrid.canvas.buffer
- The method
grid.canvas.flushBuffer()
is now a no-op
2. Added support for zoom
CSS style
style.zoom
is non-standard but widely supported. (The only exception is Firefox.)
This PR adds the following support for when a Hypergrid is zoomed by setting document.body.style.zoom
:
- Canvas resolution is now optimized with respect to the zoom settings of all the elements in the chain
- Mouse tracking coordinates are now properly adjusted when zoomed
Tested on Chrome, Safari, IE 11, and regression tested on Firefox where it has no effect.
Added method grid.resetZoom()
which should be called:
- Any time you set the
document.body.style.zoom
. This does two things: Optimizes the canvas resolution; adjusts the mouse coordinates. - After user adjusts browser zoom using ctrl +/- to optimize the resolution. This optimizes the canvas resolution for a sharper image. The mouse coordinates are not adjusted for browser zoom. The only way to tell if browser zoom changed (I believe) is to poll
getComputedStyle(htmlElement).zoom
(wherehtmlElement = document.body.parentElement
).
Important caveat: Setting
zoom
style on any other element betweenbody
andcanvas
is not accommodated byresetZoom
.
Pre-bundled build files
A bundled build of this release is available on the CDN:
fin-hypergrid.js
2.2M (includes source map)fin-hypergrid.min.js
257K (no source map)
Published to npm
This release has been published as a module to the npm registry, including umd
folder that contains the same two build files found on the GitHub CDN.