diff options
-rwxr-xr-x | CHANGELOG.md | 8 | ||||
-rwxr-xr-x | README.md | 13 | ||||
-rwxr-xr-x | dist/svg.js | 2 | ||||
-rwxr-xr-x | spec/spec/element.js | 21 |
4 files changed, 34 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d671159..a956d82 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,9 +20,9 @@ - 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!__ @@ -30,7 +30,7 @@ - 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 @@ -3175,7 +3175,7 @@ matrix.clone() __`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)') @@ -3184,12 +3184,14 @@ 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() @@ -3211,7 +3213,7 @@ matrix.add(matrix2) __`returns`: `SVG.Matrix`__ ### inverse() -Creates an inversed matix: +Creates an inverted matix: ```javascript matrix.inverse() @@ -3467,12 +3469,15 @@ Here are a few nice plugins that are available for SVG.js: ### 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. diff --git a/dist/svg.js b/dist/svg.js index fb8556f..a7cbb72 100755 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @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 diff --git a/spec/spec/element.js b/spec/spec/element.js index 8864afa..176f656 100755 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -191,11 +191,30 @@ describe('Element', function() { }) }) + 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() { |