Skip to content

Releases: CrazyTim/spin-wheel

5.0.2

02 Oct 11:19
Compare
Choose a tag to compare
  • Fix: preserve imageOpacity when assigning to Wheel.items (#49)
  • Fix: remove unnecessary call to CanvasRenderingContext2D.save() (#51)

5.0.1

10 Aug 03:45
Compare
Choose a tag to compare
  • Fix: prevent infinite resize loop when the size of the wheel's container is not fixed (#46)

5.0.0

06 Jul 05:35
Compare
Choose a tag to compare

Breaking

  • Change image properties to accept a HTMLImageElement instead of a url. This has many benefits:

    • Less code to ship, test, and maintain.
    • Simpler to use from a developer's perspective.
    • More obvious that the images should be pre-loaded.
    • There are too many use cases to support pre-loading images (for example, we need to provide a callback for when all images have loaded).
    • Closes #19.
  • Fix: rename offset properties to x and y instead of w and h

  • Fix: set label width correctly when itemLabelAlign == 'center'. Previously it was impossible to increase the label size past a certain point. This will cause "centered" labels to be larger than before.

Other

  • Fix: adjust the label's debug bounding box depending on itemLabelAlign
  • Fix: set label max width correctly when itemLabelAlign == 'center' (previously it was impossible to increase the label size past a certain point)
  • Feat: draw label anchor point when in debug mode
  • Improve validation for Wheel.itemLabelAlign
  • Don't draw debug drag points (this is only useful when testing the dragging functionality. Its not really useful for developers to see this, and its annoying in the playground)
  • Playground: adjust playground font size on small viewport
  • Playground: auto-size the right panel
  • Playground: show the hex value of the selected color
  • Playground and themes: hide wheel during page load

4.4.0

21 Jun 12:08
Compare
Choose a tag to compare
  • Fix broken export button in playground (#37)
  • Feat: use ResizeObserver to redraw the wheel when the container is resized (#26)
  • Doc: include Wheel.resize in README.md
  • Doc: add clarity about color values to README.md
  • Doc: add detail to README.md about how to draw a pointer
  • Doc: include direction parameter in spinToItem method
  • Change color of Debugging.dragEventHue
  • Add spin button to themes example page

4.3.2

30 Apr 09:25
Compare
Choose a tag to compare
  • Add two more example implementations:
    • Vue 3
    • Multiple wheels (#33)
  • Rename a few internal vars

4.3.1

27 Dec 04:28
Compare
Choose a tag to compare
  • Add proper entry points for bundlers in package.json (#25)
  • Fix: prevent exception when Wheel.remove is called twice in a row
  • Fix: refresh wheel when window.devicePixelRatio changes

4.3.0

29 Aug 13:06
Compare
Choose a tag to compare
  • Feat: add properties Wheel.itemLabelStrokeColor and Wheel.itemLabelStrokeWidth (#24)
  • Feat: add ARIA label and role to canvas element
  • Doc: add method Wheel.remove to the README
  • Fix: some lines were noticeably thicker when changing the pixel ratio to a small value

4.2.0

25 Jul 09:52
Compare
Choose a tag to compare
  • Feat: add property Item.imageOpacity
  • Feat: validate params for Wheel.spinTo
  • Fix: clear drag events when the wheel is spun
  • Fix: resize item labels when setting items
  • Fix: define default value for Item.value
  • Fix: ensure wheel is animated properly on first frame
  • Fix: continue to render remaining images when an image fails to load

4.1.1

03 Jun 13:35
Compare
Choose a tag to compare
  • Fix: sometimes dragging out of the browser window doesn't end the drag
  • Fix: reset cursor after changing Wheel.isInteractive

4.1.0

19 May 06:57
Compare
Choose a tag to compare
  • Fix: reinstate Wheel.spin() method
    • This method was removed in the last release, however setting rotationSpeed directly to spin the wheel was less obvious, and there was no way to raise the onSpin event.
    • So instead the rotationSpeed method was made readonly.
  • Improve validation for Wheel.rotationSpeedMax (should be a number >= 0)