jakubfiala/atrament
 Watch   
 Star   
 Fork   
2025-09-26 18:38:12
atrament

Atrament v5.1.0

This release includes a bugfix by @NaoCoding for situations where left-clicking away from the contextmenu already triggers pointermove - see #115

Thanks @NaoCoding for the report and PR!

2025-07-16 17:26:19
atrament

Atrament v5.0.0

Most of these improvements were generously supported by @ynput and their AYON software - huge thanks to the whole Ynput team for contributing and helping evolve Atrament.

Breaking API changes

  • Atrament does not include the fill Worker within the main bundle anymore. This is so applications that don't require fill mode benefit from an approx. 60% smaller import size. The fill module can be imported separately and injected into Atrament via the constructor.
  • Atrament now maps the pointer coordinates (pixels relative to the <canvas> element) to unitless fractions of the intrinsic canvas size. This eliminates the need to consider things like devicePixelRatio, since the coordinates are independent of screen pixel density. The resolution config option has been removed.

Drawing experience changes

  • pressure sensitivity has been reworked to have much more impact on the stroke, and new config options have been added to tweak the pressure mapping. The options are pressureLow, pressureHigh and pressureSmoothing - see README for more info

Other changes

  • there is now a secondaryEraser config option, which allows the secondary (e.g. right) mouse button to be used as an instant eraser without changing modes
  • recorded strokes now also include pressure information so they can be reproduced correctly
  • strokestart and strokeend now also return x/y coordinates
  • a new config option ignoreModifiers makes Atrament ignore pointer events if any modifier keys are pressed. This is useful if you'd like to use pointer events with modifiers for other things than drawing (e.g. Ctrl+Click+Drag to pan around the canvas).
2025-01-19 17:56:53
atrament

Atrament v4.6.0

This release addresses the issue where non-primary mouse buttons were triggering drawing. This is not desirable as these buttons aren't typically used for drawing actions - instead, they tend to be mapped to things like context menus and navigation. Thanks @Innders for the suggestion!

2025-01-06 17:43:59
atrament

Atrament v4.5.0

This version adds a new config option, resolution. This allows the developer to override the default DPI scaling - this is useful if, for instance, you'd like to export the image at a higher resolution than displayed.

Big thanks to @Innders for the suggestion!

2024-06-28 03:08:30
atrament

Atrament v4.4.1

This release bundles Atrament with a target platform specified for rollup-plugin-web-worker-loader.

This fixes #103 (thanks @ak37165 for the issue) and also decreases the final bundle size slightly, because code to check whether the code is executing under Node.js isn't bundled. This code wasn't necessary in the first place, because Atrament is only supposed to execute in browsers.

2024-05-19 19:04:51
atrament

Atrament v4.4.0

This release fixes #101 reported and fixed by @nichoth 🙏

2024-05-16 20:03:21
atrament

Atrament v4.3.0

This release fixes #99 as reported by @nichoth, who also kindly provided the fix 🙏

2024-04-26 17:08:31
atrament

Atrament v4.2.0 🥦

Almost managed to release this one on the correct date!

This version makes one important change for applications where the canvas is not taking up the whole screen. If the pointer leaves the canvas (Atrament handles the pointerout event), Atrament will now end the stroke, instead of pretending it continues. This helps avoid unexpected stroke paths when returning to the canvas.

Another fix I made was that Atrament now "forgets" the previous mouse position even if the pointerup event fires when the pointer is outside of the element. This prevents unexpected stroke paths when beginning a new stroke.

2024-03-28 18:21:41
atrament

Atrament v4.1.0

This version should fix #98 - it changes how the dirty flag behaves, as it's now toggled in the draw() method. This means it will also be true if drawing programmatically, not just when using a pointer (mouse/touch/stylus).

Another change is that the clear() method now clears the canvas regardless of whether Atrament has drawn on it. I believe this will lead to more predictable behaviour. The method has also been refactored to take into account the canvas transform.

2024-03-24 06:44:22
atrament

Atrament v4.0.1

This release changes the license to MIT. I was a silly 22-year-old when I initially released Atrament, licensing it under Phil Sturgeon's DBAD License because I found it funny. I did not anticipate that, years later, Atrament would have 1.4k stars and be used by over 100 projects just publicly listed on GitHub, and potentially many more.

While I still like the DBAD License and find it funny, I don't think it's the best idea for a serious OSS project's license to include that sort of language. I don't particularly want Atrament's users to buy me pints, even though I do like beer a lot. It would also exclude all the other wonderful people who contributed to the library over the years.

I chose the MIT License because:

  1. in terms of real world consequences, it's not really very different from DBAD
  2. it is the most common OSS license and I think it's fine

While I think license changes should normally result in a major version upgrade (some people even suggest publishing a new package), I find this to be a negligible change for even the most legally restrictive organisations, and could not justify a major bump, so I'm simply doing this as a patch. I'd be happy to address any concerns raised via GitHub issues.