Commit Graph

156 Commits

Author SHA1 Message Date
David Johansson
8f8fcc8a90 Fix bug with toJSON, all properies of nodes were not serialized if some native objects of JS were extended. 2012-09-24 21:26:13 +02:00
Eric Rowell
8883e80bfe cleaned up _getContentPosition() method and fixed event detections for stages below the fold on mobile devices 2012-08-26 22:42:54 -07:00
Eric Rowell
c01c08d557 now removing color key from shapes hash when a shape is removed from the stage 2012-08-26 18:25:51 -07:00
Eric Rowell
89611aed5f rounding pos components when used with getImageData 2012-08-26 12:23:29 -07:00
Eric Rowell
79a1029adb fixed getIntersections bug 2012-08-26 11:00:18 -07:00
Eric Rowell
1ad2530889 removed john resig's Class class because it was really slowing down node instantiations. Created a custom solution that's much lighter weight, and about 50% faster 2012-08-22 23:35:21 -07:00
Eric Rowell
d48aa321f4 removed resig's Class dependency to test performance gain 2012-08-22 23:13:09 -07:00
Eric Rowell
0640e0b705 mouseover and mouseout events should not fire during drag and drop 2012-08-19 23:46:06 -07:00
Eric Rowell
9093d9a512 refactored draw, _draw, and _drawChildren methods in such a way that isVisible and getListening logic resides in one place, therefore improving code quality 2012-08-19 20:44:45 -07:00
Eric Rowell
e19dae3402 rewrote intersects method, which now leverages the new getIntersection method. fixed up unit tests. also fixed bug with getIntersection method 2012-08-18 22:42:37 -07:00
Eric Rowell
f944409a1e new hit detection algo works with images that contain transparent pixels. Devs will need to use the createImageBuffer() method to create a higher precision buffer image 2012-08-18 22:02:16 -07:00
Eric Rowell
e6e488025e hit detection color mapping now takes into account anti-aliasing color variations, which was causing issues when moving the mouse from one shape into another shape which were inside the same group. created getIntersections() method which returns an object with shape and pixel data 2012-08-16 23:03:28 -07:00
Eric Rowell
9cdbadc4fd refactored ancestor comparison logic to ensure that container handlers aren't incorrectly executed for mouseover mouseout. Fixed up functional tests 2012-08-16 22:03:39 -07:00
Eric Rowell
02c6c7276f continued prep work for v4.0.0. removed detectionType property because new event engine uses one strategy. added new drawBuffer method so that you can redraw the buffer without redrawing the visible canvas. changed alpha to opacity. 2012-08-13 23:06:29 -07:00
Eric Rowell
ef14edede3 major refactoring of the event engine to better support new hit detection strategy 2012-08-11 23:14:49 -07:00
Eric Rowell
468f8ef2d3 checking in first phase of new hit detection algo, which enables high performance event detections even if there are hundreds of thousands of shapes. This is a giant improvement over the previous algo, and is a fairly big architectural change. Since the Animation architecture and API is also changing, I feel that these changes are big enough to warrant a new major version, v4.0.0 2012-08-11 16:22:01 -07:00
Eric Rowell
0f1a424840 prototyping back buffer hit detection algo 2012-08-10 22:33:22 -07:00
Eric Rowell
8c147ee2b5 added new performance test in preparation for new hit detection algo investigation 2012-08-10 20:48:42 -07:00
Jason Follas
1d6acca8f3 Fixed flaw in Stage.toDataURL where JPEG layers were hiding lower layers due to the use of black instead of transparent. 2012-08-09 22:39:34 -04:00
Eric Rowell
66ba99f9bc hooked drag and drop into animation engine 2012-08-09 00:01:21 -07:00
Eric Rowell
b6db65301c rewrote Animation API to improve flexibility. Animations are no longer tied to the stage. You can now instantiate as many individual animations as you like, and manage them however you like 2012-08-04 00:23:56 -07:00
Eric Rowell
9ad9121259 Kinetic.Animation is now a class that can be instantiated to better represent animation objects. Rather than creating new animation objects and destroying them each time an animation is started and restarted, the same animation obect is now reused, which should help with performance 2012-07-31 23:23:00 -07:00
Eric Rowell
87182d704c fixed bug with stage.remove(layer). layer canvas context is now correctly removed from the dom 2012-07-28 22:16:29 -07:00
Eric Rowell
1585cc3620 fixed tests 2012-07-27 18:41:15 -07:00
Eric Rowell
eccd8b7e64 silky smooth animations. got rid of layer and event throttling, and instead created dragThrottling. The dynamic animation frame rates already handles optimized animation drawing, we just needed to add manual throttling to drag and drop. Animations are now very smooth, and drag and drop is still smooth 2012-07-26 23:26:58 -07:00
Eric Rowell
ce3b98ee9c added some performance tweaks and polished up code here and there 2012-07-26 22:58:38 -07:00
Eric Rowell
5f7b6018fa finally got around to documenting the Node, Group, Stage, Shape, Layer, and Container constructors 2012-07-23 22:39:55 -07:00
Eric Rowell
3997d74317 updated more docs 2012-07-23 00:00:22 -07:00
Eric Rowell
3617d8ef5f updated docs 2012-07-22 23:30:56 -07:00
Eric Rowell
f1cb695e1f you can now cache regions of a node outside of the stage viewport. added more unit tests 2012-07-21 15:38:25 -07:00
Eric Rowell
d74ec8ab06 fixed new bug with stage toDataURL that was introduced with the new Canvas class, and added new filter unit tests 2012-07-21 13:29:22 -07:00
Eric Rowell
c09742c77c formatted pull request 2012-07-18 23:53:28 -07:00
ericdrowell
148cde228a Merge pull request #52 from Country/master
Miscalculation of container position
2012-07-18 23:39:28 -07:00
Eric Rowell
d8bbbf6353 new Canvas class to decouple layer and canvas, providing more flexibility. drawing operations now require a canvas object rather than an optional layer which contained a canvas. fixed some transformation issues introduced with a pull request that I pulled in last week 2012-07-18 23:28:45 -07:00
Yannick Croissant
e46dfdb565 Fix _getContentPosition, the position was miscalculated if a positioned container had a border. 2012-07-17 13:14:49 +03:00
Eric Rowell
384a686740 worked through some synchronous / asynchronous issues with toDataURL and toImage(). stage toDataURL() is now asynchronous, and all other node toDataURLs is still synchronous. toImage() is now asynchronous. Kinetic.Image once again only accepts image objects, and can no longer be instantiated with a data URL or image data due to asynchronous issues. It's much cleaner for the developer to load an image however they like, and then instantiate a Kinetic.Image shape synchronously 2012-07-15 20:12:18 -07:00
Eric Rowell
4692c51c74 toDataURL() is now synchronous, and works with all nodes, including the stage, layers, groups, and shapes. This also sets things up nicely for node caching. You can now cache anything, including the whole stage, layers, groups, or shapes, manifested as Kinetic Images that were instantiated with data urls 2012-07-14 18:10:37 -07:00
Eric Rowell
d62df7ba5c setup filters. saveImageData can now work for any nodes, including shapes, groups, layers, and the stage. images can now take image data as a parameter. This enables shape caching. New beforeAttrChange event which fires before an attr is changed 2012-07-14 16:25:56 -07:00
Eric Rowell
5bfcf3ffa8 the stage ids and names hashes are now updated correctly whenever a node's id or name changes 2012-07-13 21:24:38 -07:00
Eric Rowell
d4f03e64b1 removed unecessary regex in Class file which was tripping up the JS minifier 2012-07-11 22:55:18 -07:00
Eric Rowell
780d5568db updated the documentation for all methods to reflect the new inhertiance changes. And yes, if you're curious, it took forever. 2012-07-08 21:56:52 -07:00
Eric Rowell
5169c93219 fixed afterFrame index bug which caused the event to trigger on the wrong index 2012-07-08 19:15:23 -07:00
Eric Rowell
9baaee2440 getIntersections no longer returns visible shapes in the result set, and can also be called from any container 2012-07-06 21:45:18 -07:00
Eric Rowell
de7cab4cf3 moved animation logic into Animation.js. Global.js now only contains logic and properties that operate on stages 2012-07-03 23:00:52 -07:00
Eric Rowell
6126c73a84 moved data type logic into new utility files Type.js and renamed GlobalObject to Global 2012-07-03 22:08:59 -07:00
Eric Rowell
3d4d2d20c0 now utilizing John Resig's mashup of Base.js and protototype.js inheritiance Class so that it's easy for developers to extend KineticJS objects with extend() or to simply tack on new methods and properties that's available to all children classes. Moved getter and setter logic to Node. Moved transition class to root directory and created Tween class 2012-07-03 12:07:27 -07:00
Eric Rowell
f8f46daafe added work around for strange formatting error 2012-07-01 20:58:13 -07:00
Eric Rowell
c1a08d8073 created new addSettersGetters method, further enhanced dynamic getters and setters 2012-06-23 18:09:10 -07:00
ericdrowell
ca6e8f1d14 Merge pull request #32 from boatmeme/11a1662c0e3e8c9bd20db2ac8ff3f2572b337cb7
Calling stage.toJSON() prevents subsequent drawing on existing child layers
2012-06-21 21:35:01 -07:00
Eric Rowell
5765ab749b converting arguments object into true array for setters, restored the original underscore.js methods, and moved radius conversion logic from the setAttrs method to a radiusChange event listener in Ellipse 2012-06-20 12:55:34 -07:00