Commit Graph

140 Commits

Author SHA1 Message Date
Eric Rowell
cc35abd0f6 first round of new Path shape. Despite multiple optimizations, the path performance isn't as good as a previous experiment done with v3.8.1. Will keep this as a separate branch until the performance issues are resolved 2012-05-27 21:46:03 -07:00
Eric Rowell
4488f22c32 added drag and drop support for the stage. This essentially enables stage panning 2012-05-27 00:07:36 -07:00
Eric Rowell
e075a725a1 rewrote shadow logic. Shadows can now be applied to images and sprites, even if they have transparent pixels 2012-05-26 20:34:36 -07:00
Eric Rowell
af31e1ee83 refactored stage.reset method. Now storing node default attrs as an object which can be used by the stage to reset itself 2012-05-26 18:40:43 -07:00
Eric Rowell
44ba6f7e5b bug fix - when setting a custom attr that points to self, the setAttrs method no longer gets stuck in a recursive loop throwing a stack overflow error. Also, objects that were instantiated from a class (non-literal objects) are no longer serializable 2012-05-26 18:31:13 -07:00
Eric Rowell
fd6bdb570c refactored get() and add() node methods. much cleaner now. 2012-05-26 16:49:58 -07:00
Eric Rowell
07edfbc765 hooked setAttrs into setCrop() method and made the _getSize() method more flexibile by accepting more variations of input. added unit tests 2012-05-26 16:37:37 -07:00
Eric Rowell
8c675327b9 hooked in the setAttrs method to the shadow setter and the pattern fill setter. added more unit tests 2012-05-26 10:57:56 -07:00
Eric Rowell
0bb158c0fb hooked setAttrs into setPosition and setScale for more flexibility. Added in depth position and scale unit tests. add() and remove() methods are now chainable 2012-05-25 20:18:05 -07:00
Eric Rowell
5526d2847e forgot to move the image object to the attrs for Kinetic.Image and Kinetic.Sprite 2012-05-20 21:41:05 -07:00
Eric Rowell
61d325d383 fixed up some issues with serialization and deserialization and updated unit tests 2012-05-20 16:42:37 -07:00
Eric Rowell
e26575a6c8 fixed flickering when a node was added to the stage, updated, and redraw due to throttling 2012-05-20 15:30:32 -07:00
Eric Rowell
2331222459 linear and radial gradients can now have any number of color stops 2012-05-20 11:12:07 -07:00
Eric Rowell
4ba2818f97 improved shadow code quality and added support for text fill and stroke shadows 2012-05-20 10:47:28 -07:00
Eric Rowell
97ddb507ea fixed layer drawFunc bug. Now using call() for layer beforeDraw and afterDraw custom functions so that they are executed from the layer's context 2012-05-19 22:18:33 -07:00
Eric Rowell
7fcf5f156a added support for shadow alpha property 2012-05-19 22:11:33 -07:00
Eric Rowell
e60eb8be6e tons of refactoring to make the code base even more elegant and flexibile. In particular, the setAttrs() method is much more powerful now, and serves as a really convenient way for setting a bunch of node properties at once 2012-05-19 21:14:04 -07:00
Eric Rowell
2ac2c2856c transitions can now operate on ANY numeric value for any Node object, regardless of the property's depth in a config object tree 2012-05-13 18:59:10 -07:00
Eric Rowell
9944b897c4 added support for heigt and width properties inside an object config property to be transition-able 2012-05-13 17:04:15 -07:00
Eric Rowell
1c36f208c0 added gaurd against infinite slopes for dashed lines 2012-05-13 16:23:58 -07:00
Eric Rowell
5045c3fbc4 fixed slop calculation bug with dashed line logic 2012-05-13 16:00:18 -07:00
Eric Rowell
c6040ebf9d a bit of refactoring here and there, added some getters and setters that i missed in Kinetic.Sprite 2012-05-13 14:04:29 -07:00
Eric Rowell
ec415c55de added _setPoints so that points setter methods could leverage the same logic that was in the setAttrs() method 2012-05-13 11:58:40 -07:00
Eric Rowell
7f8a174b51 fixed bug with _setSize() 2012-05-13 11:32:26 -07:00
Eric Rowell
7be0e5f577 refactored _getXY utility and usage 2012-05-13 10:46:49 -07:00
Eric Rowell
e4f5e11792 finished up pattern fill support 2012-05-13 10:27:40 -07:00
Eric Rowell
81df49e75d pulled out _setPointAttr from Node and moved it to the GlobalObject as _setXY, which enables x,y property setting for any object, not just attrs. also added _setSize which has similar logic for height width properties 2012-05-12 18:37:07 -07:00
Eric Rowell
9e3475f37a setup support for pattern fills 2012-05-12 18:18:06 -07:00
Eric Rowell
92919058b2 after a bit more thought, I've decided to change the maxWidth property to width, to make it even more similar to CSS sizing rules. If you set the width of the text box to a certain value, and the text string width is longer than that width, the text will be clipped 2012-05-12 17:49:01 -07:00
Eric Rowell
05df078295 reworked text max width logic to use clipping rather than native max width functionality which scales the text (what was w3c thinking? no idea) 2012-05-12 17:11:57 -07:00
Eric Rowell
502115fad7 Kinetic.Line detection type is now defaulted to pixel since this is the expected detection strategy 2012-05-12 15:45:04 -07:00
Eric Rowell
51258531bf fixed bug with getTextSize() which was throwing a JS error if used before adding text to the stage 2012-05-12 15:32:27 -07:00
Eric Rowell
1146919d3d modified setDefaultAttrs() so that it doesn't overwrite attrs defaulted in a custom class that extends a Kinetic class 2012-05-12 15:15:42 -07:00
Eric Rowell
28f7fc246d changed shadowFillStroke() to applyStyles(). Took applyLineJoin() out of shape draw functions and moved it to the Shape._draw() method. 2012-05-09 22:31:55 -07:00
Eric Rowell
2993191fe6 improved shadow logic such that it first attempts to apply shadows to a shape's fill if it's defined, otherwise it will attempt to apply the shadow to the stroke 2012-05-09 19:15:49 -07:00
Eric Rowell
16c251bb97 added drawFunc property to layer so that layers can easily draw non-node background graphics 2012-05-09 18:53:20 -07:00
Eric Rowell
a27741ce03 added shadow support. changed fillStroke method to shadowFillStroke 2012-05-08 23:06:13 -07:00
Eric Rowell
622278a510 point properties can now be set with an array of points or an array of numbers for convenience 2012-05-08 22:11:37 -07:00
Eric Rowell
40ebb21033 implemented dashed and dotted line styling for Kinetic.Line based on method written by Phrogz 2012-05-08 19:11:19 -07:00
Eric Rowell
f2976e7dd1 added support for linear gradients and radial gradients using the fill property 2012-05-03 14:20:50 -07:00
Eric Rowell
7d92a2099e fixed animation race condition bug that sometimes produced multiple requestAnimFrame calls, and also changed throttle property to be in fps (it used to be in ms). This will make it more consistent with other properties related to frame rates 2012-05-03 12:05:54 -07:00
Eric Rowell
3585e000b6 added new Kinetic.Sprite shape that enables you to easily add animated sprites to the stage 2012-05-02 00:35:32 -07:00
Eric Rowell
7bcd34ec47 added new beforeDraw() and afterDraw() event handlers for Layer 2012-04-28 23:03:58 -07:00
Eric Rowell
1dbe93a232 added new Line Shape 2012-04-28 21:12:01 -07:00
Eric Rowell
ffd9924511 tweaked throttling algo and added unit tests 2012-04-28 19:52:45 -07:00
Eric Rowell
ff31dcb0ae fixed small bug related to animations - if you called .start() multiple times, multiple animation instances would be created. This wasn't desirable. Also beefed up animation unit tests 2012-04-28 18:33:05 -07:00
Eric Rowell
e8dcb8e584 fixed glitchy flash on transitions when applying multiple transitions to the same node at different times 2012-04-28 17:45:13 -07:00
Eric Rowell
bd17b54aa8 added stage.reset() method so that you can reset the stage to its original state. hooked this in with stage.load() so that the stage starts when a clean slate when loading json 2012-04-28 13:57:43 -07:00
Eric Rowell
9cc380608e fixed drawing bug related to new throttle feature 2012-04-28 13:46:54 -07:00
Eric Rowell
6bed850042 added defensive coding when removing node from container in case it has not yet been added to the container 2012-04-28 13:06:22 -07:00