- completely reworked `clone()` method to use the adoption system
- added support to clone manually built text elements
- added `svg.wiml.js` plugin to plugins list
-- added `ctm()` method to for matrix-centric transformations -> __TODO!__
-- added `morph()` method to `SVG.Matrix` -> __TODO!__
-- added support for new matrix system to `SVG.FX` -> __TODO!__
+- added `ctm()` method to for matrix-centric transformations
+- added `morph()` method to `SVG.Matrix`
+- added support for new matrix system to `SVG.FX`
- completely reworked transformations to be chainable and more true to their nature
- changed `lines` reference to `lines()` on `SVG.Text` -> __TODO!__
- changed `track` reference to `track()` on `SVG.Text` -> __TODO!__
- added raw svg import functionality with the `svg()` method -> __TODO!__
- moved sup-pixel offset fix to a separate plugin -> __TODO!__
- added `native()` method to elements and matrix to get to the native api
-- added `untransform()` method to remove all transformations -> __TODO!__
+- added `untransform()` method to remove all transformations
- fixed a bug in IE11 with `mouseenter` and `mouseleave` -> __TODO!__
- switched from Ruby's `rake` to Node's `gulp` for building [thanks to Alex Ewerlöf]
- added coding style description to README
__`returns`: `SVG.Matrix`__
### morph()
-In order to animate matrices the `morph()` method lets you pass a destination matrix. This can be any value that a `SVG.Matrix` would accept on initialization:
+In order to animate matrices the `morph()` method lets you pass a destination matrix. This can be any value a `SVG.Matrix` would accept on initialization:
```javascript
matrix.morph('matrix(2,0,0,2,100,150)')
__`returns`: `itself`__
### at()
-This method will morph the matrix to a given position between `0` and `1`. Continuing with the previous example:
+This method will morph the matrix to a given position between `0` and `1`:
```javascript
matrix.at(0.27)
```
+This will only work when a destination matirx is defined using the `morph()` method.
+
__`returns`: `SVG.Matrix`__
### multiply()
__`returns`: `SVG.Matrix`__
### inverse()
-Creates an inversed matix:
+Creates an inverted matix:
```javascript
matrix.inverse()
### topath
[svg.topath.js](https://github.com/wout/svg.topath.js) to convert any other shape to a path.
+### topoly
+[svg.topoly.js](https://github.com/wout/svg.topoly.js) to convert a path to polygon or polyline.
+
### wiml
[svg.wiml.js](https://github.com/wout/svg.wiml.js) a templating language for svg output.
## Contributing
-We love contributions. Did you si it? The word LOVE? Please make sure you follow the same coding style, here are some guidelines.
+We love contributions. Yes indeed, I used the word LOVE! But please make sure you follow the same coding style. Here are some guidelines.
### Indentation
We do it with __two spaces__. Make sure you don't start using tabs because then things get messy.
* @copyright Wout Fierens <wout@impinc.co.uk>
* @license MIT
*
-* BUILT: Sat Jul 26 2014 22:10:03 GMT+0200 (CEST)
+* BUILT: Sun Jul 27 2014 13:36:08 GMT+0200 (CEST)
*/
;(function() {
// The main wrapping element
})
})
+ describe('untransform()', function() {
+ var circle
+
+ beforeEach(function() {
+ circle = draw.circle(100).translate(50, 100)
+ })
+
+ it('removes the transform attribute', function() {
+ expect(circle.node.getAttribute('transform')).toBe('matrix(1,0,0,1,50,100)')
+ circle.untransform()
+ expect(circle.node.getAttribute('transform')).toBeNull()
+ })
+ it('resets the current transform matix', function() {
+ expect(circle.ctm()).toEqual(new SVG.Matrix(1,0,0,1,50,100))
+ circle.untransform()
+ expect(circle.ctm()).toEqual(new SVG.Matrix)
+ })
+ })
+
describe('ctm()', function() {
var rect
beforeEach(function() {
- rect = draw.rect(100,100)
+ rect = draw.rect(100, 100)
})
it('gets the current transform matrix of the element', function() {