Skip to content

Hypergrid v3.3.2

Latest
Compare
Choose a tag to compare
@joneit joneit released this 25 Nov 22:20
902a52e

Minor version update

This release introduces new functionality while remaining interface-backwards-compatible with prior v3.. releases.

Contents

  1. Removed off-screen blitting support (See PR #810)
  2. Added support for zoom CSS style (See PR #814)

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, and grid.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:

  1. Canvas resolution is now optimized with respect to the zoom settings of all the elements in the chain
  2. 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:

  1. Any time you set the document.body.style.zoom. This does two things: Optimizes the canvas resolution; adjusts the mouse coordinates.
  2. 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 (where htmlElement = document.body.parentElement).

Important caveat: Setting zoom style on any other element between body and canvas is not accommodated by resetZoom.

Pre-bundled build files

A bundled build of this release is available on the CDN:

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.