Previously, each listener function had a private _on property which recorded
whether the listener was enabled; this was set to false when the listener was
removed. (This is necessary because of the copy-on-write semantics when the
array of listeners is modified while events are being dispatched.) If the
listener was registered for multiple event types ("foo" and "bar") then removing
the listener for any type would disable it for all types.
The fix is to wrap the listener in an object. This also has better encapsulation
since the state is kept private.
This fixes various corner cases involving negative and zero scales, as
well as proper support for skewX, which previously wasn't being computed
correctly.
Fixes#377.
We need to check the matrix determinant for flipped coordinates. We also need to
check for invalid transforms, which are now treated as the identity transform.
See #312. The also fixes the zoom behavior so that it cleans up temporary state
when the zoom gesture is done. And, it fixes both behaviors such that the
mouseup event is always stopped from propagation if a gesture occurs (even if a
subsequent click is not prevented).
This allows you to specify how the drag behavior should infer the current
position of the targetted element, such that a fixed offset can be maintained
between the mouse position and the element position for the duration of the drag
gesture. For example, if your data is an {x, y} object, use origin(Object).
This required changing assert.length to assert.lengthOf in tests, due to
a Vows.js change to be compatible with Node.js v0.6.x. For further
details:
https://github.com/cloudhead/vows/pull/141
Using d3.range with a floating point step is a bit sketchy, because there's a
chance that too many or too few elements could be generated. Instead, we now we
generate an integer range and scale it accordingly.