TagCanvas 2.1.2
Published
A small update to TagCanvas this time, all it does is scale the cursor position in browser or screen pixels to match the pixels in the canvas. That doesn't sound very interesting, but it means that using CSS to change the size of the canvas will no longer mean that the mouse doesn't select the tags properly.
This does not mean that you can use CSS to set the canvas size without using the
canvas element's width
and height
attributes - they
are still required to set up the size of the canvas in pixels. If you use CSS to
change the size of a canvas, it will use the width and height given by these
attributes internally.
This means that increasing the size of a canvas using CSS is likely to cause aliasing, so try to set the width and height attributes as close to the actual size as possible or it might not look very good.
I didn't say anything about version 2.1.1 when I released it, mainly because it
was a very simple change to fix an undocumented feature used by the Drupal
module. It was undocumented because I hadn't thought of it or realised it was
possible - which is also why I broke it in version 2.0. Basically, the ID of the
tag container can be a selector to limit the tags to a subset of the links - in
jQuery terms, it looks like this: $('#' + tagsID)
. In version 2.1.1
I reimplemented this using document.querySelectorAll()
, so it will
work in all modern browsers whether you use the jQuery plugin version or the
stand-alone version.
The updated TagCanvas files are all available from the TagCanvas page.