Commit Graph

222 Commits

Author SHA1 Message Date
Eric Rowell
9fd5df4d79 drag and drop logic now works correctly on mobile when both the stage is draggable and a shape 2013-04-06 22:29:35 -07:00
Alex Ahn
d1516bf727 stage layers length fix 2013-04-03 15:43:32 -04:00
Eric Rowell
22aaa15562 fixed #348 2013-04-02 22:29:56 -07:00
Eric Rowell
dc107a06ae fixed small logical error with startDrag() 2013-03-24 20:54:59 -07:00
Eric Rowell
3c63b13c95 fixed drag and drop regression bug 2013-03-24 18:17:58 -07:00
Eric Rowell
a4d1dc8dab stage drag and drop works again. continued refactoring DragAndDrop.js 2013-03-24 02:31:39 -07:00
Eric Rowell
f0037ce9c6 cleaned up Stage.js 2013-03-23 23:50:51 -07:00
Eric Rowell
3a903d6c7c minor refactoring. fixed bug related to click mapping 2013-03-23 23:19:24 -07:00
Eric Rowell
ce793a4b25 refactored / cleaned up code in Node and DD 2013-03-23 22:56:22 -07:00
Eric Rowell
b5c1bc633a removed dynamic drag and drop layer all together. In the end, the performance benefits (small) did not out weigh the complexity consequences 2013-03-23 21:47:15 -07:00
Eric Rowell
c31abf6be3 changed getUserPosition to getPointerPosition, and setUserPosition to setPointerPosition 2013-03-23 20:15:49 -07:00
Eric Rowell
966ebf2a32 lots of refactoring, and code hardening. Also fixed bug in which dragend events were being fired before mouseup/touchend events 2013-03-23 20:02:11 -07:00
Eric Rowell
0c80f6e223 rewrote dynamic drag and drop layer because the old implementation had too many problems. This resolves all of the dynamic drag and drop issues in one go. draw() method can now be applied to any node, not just the Stage and Layers. drag events now bubble 2013-03-22 00:46:41 -07:00
Eric Rowell
0dbda82886 created _upperCase util method for function and event name generation, and did some refactoring 2013-03-21 20:24:03 -07:00
thulka
b043a2f931 Improvement of event handler performance in Stage
The event handler function was fetched upon every fired event. This is
now avoided by fetching the function once before adding the listener.
This is partly a refactoring but also changes the code, since changes of
the events in that[] are now considered only during the call of
_bindContentEvents. If an event is removed however, the previous code
would crash, since that['_' + event] would then be null. Performance
profiling showed slight advantage, from 20% spent to 18% spent inside
event handler. And the code is cleaner.
2013-03-19 17:15:24 +01:00
Eric Rowell
69f9374c8e first pass at removing setDefaultAttrs logic to speed up node instantation performance 2013-03-15 08:33:05 -07:00
Eric Rowell
46f71d283f added clipping functionality to containers. Currently, the clipping function can only be applied to layers and groups. The clipping region is also subject to the containers transforms, which means that you can also create transformed clipping regions. 2013-02-15 18:20:34 -08:00
Eric Rowell
66cc6cd98c added support to define pixel ratio with Canvas constructor 2013-02-12 10:29:23 -08:00
Eric Rowell
26943f8245 implemented new pixel ratio logic, which covers all drawing cases using a canvas context. The new logic also has better performance than the previous 2013-02-12 09:58:47 -08:00
Eric Rowell
1bcdd15f45 drag and drop now ends whenever a mouseup or touchend event is detected anywhere on the page 2013-01-27 22:25:16 -08:00
Eric Rowell
be295992e0 when parent and children are both draggable, the lowest level child draggable property now has priority over ancestors. Refactored dependency order in thorfile 2013-01-27 21:29:22 -08:00
Eric Rowell
b1038e99bf pulled Node config params and Shape config params into a textfile, and now using token replacement to auto fill Node and Shape config params throughout the code base. In this way, if I need to make changes to the Node or Shape configs, those changes are propagated to all of the other constructors 2013-01-26 20:42:19 -08:00
Eric Rowell
abbaef1cc6 refactored drag and drop a bit and fixed a dependency bug 2013-01-13 22:32:08 -08:00
Eric Rowell
8ed84f474a fixed several memory issues with transition logic. Heavily refactored Transition module. New Animation isRunning method. destroy() method now correctly stops currently running transitions. added several transition and destroy related unit tests 2013-01-13 19:59:35 -08:00
Eric Rowell
b6ba1a503c ids and names hashes used for node selection via get() has moved to Global in order to greatly simplify the selection logic. This means that node ids and names are shared across all stages. If two stages each have a node with the same id, only the last id set will be accessibile (similar to DOM) 2013-01-13 11:10:49 -08:00
Eric Rowell
f5f2fbaba9 added stage getDragLayer() method and unit tests 2013-01-12 23:45:28 -08:00
Eric Rowell
5cda46be69 drag and drop layer is now created on stage instantiation, and is removed and added as needed 2013-01-12 23:39:56 -08:00
Eric Rowell
ed579e4843 added new destroy Node method which removes and destroys a node. remove() now simply removes a node from the stage. You can re add the node at a later time with add(). getDOM() changed to getContent(). stage.remove() now correctly removes content node 2013-01-12 22:01:12 -08:00
Eric Rowell
bba5c7b101 really cool new feature that... wait, no, just more docmentation 2013-01-02 23:55:56 -08:00
Eric Rowell
31ad5fca88 updated docs 2013-01-02 21:35:51 -08:00
Eric Rowell
7ba40a6a68 drag and drop operatons now dynamically generate a temporary top layer for high performance drag and drop. When completed, the top layer is removed. Also cleaned up a bit of drag and drop logic 2012-12-30 23:14:23 -08:00
Eric Rowell
36584a3ce2 cleaned up docs, and beefed up individual shape docs. moved corner radius attr to Rect shape 2012-12-22 23:08:03 -08:00
Eric Rowell
375c64a332 added counter pixel ratio method so that drawings aren't double scaled when using toDataUrl and toImage 2012-12-21 22:51:57 -08:00
Eric Rowell
aa05f90ea4 updated stage docs 2012-12-16 20:52:07 -08:00
Eric Rowell
16f81f6204 fixed up stage toImage() translation problem 2012-12-11 00:21:43 -08:00
Eric Rowell
cb8d36c393 fixed several bugs with toImage(). toImage() can now also accept x and y params. added extensive caching unit test. removed drawBuffer logic as it is no longer needed 2012-12-11 00:08:59 -08:00
Eric Rowell
291583148b moved all rendering logic into the Canvas renderer modules. Shape draw funcs are now passed a renderer object, not a canvas context. The context is accessible via canvas.getContext() 2012-12-09 09:52:33 -08:00
Eric Rowell
ab19b442a0 wrapped all modules with anonymous func. moved Canvas to root dir because it's now coupled to KineticJS logic. removed whitelisting arrays from Global. Did some prep work for AMD and Node support 2012-12-01 12:04:10 -08:00
Eric Rowell
27d5031665 further decoupled scene, hit, and buffer graph drawing. To define a custom hit draw function, you now need to set the drawHitFunc attr. 2012-11-18 19:50:50 -08:00
Eric Rowell
2115920ab8 fixed up Canvas type bug. The Canvas constructor can now also take an optional isBuffer param. If not defined, default value is scene 2012-11-13 22:16:36 -08:00
Eric Rowell
5be1802729 fix #149 began decoupling scene graph draw and buffer graph draw logic. This will enable more flexibility for developers to define custom buffer draw functions, and it also improves draw performance for both the scene and buffer graphs, because each function can be optimized for its purpose. Also moved text drawing logic to the Text shape 2012-11-12 19:59:19 -08:00
Eric Rowell
908fa24b8e fix 149 cleaned up Kinetic.Canvas usage 2012-11-10 17:05:35 -08:00
Eric Rowell
0b9af3028c continued refactoring and decoupling drag and drop logic. The code base now looks fully decoupled as far as I can tell - next step is to test configurator combinations 2012-10-14 20:22:22 -07:00
Eric Rowell
3d0cb26e6d updated build file to also minify modules separately for custom builds. Started work on decoupling Animation and DragAndDrop logic from other modules 2012-10-14 18:46:04 -07:00
Eric Rowell
0ae50ba523 merge trunk 2012-10-10 19:25:50 -07:00
Eric Rowell
2426c2bd2c moved width and height attrs to node level. This enables us to get and set shape dimensions via width and height. For example, if you have a circle with radius 50, getWidth() will return 100. Not all shapes width and height methods have been implemented yet 2012-10-10 18:48:08 -07:00
ericdrowell
f74955641a fixed multiple bugs related to toDataURL() when using hidden layers 2012-10-07 19:38:12 -07:00
ericdrowell
432533ae4a greatly improved the OO design for draw logic. removed unecessary _draw() and __draw() methods 2012-10-07 19:14:14 -07:00
David Johansson
8e03a97d46 Improved get method to inlude get by shapeType. Also improved the oo-design. 2012-10-06 23:35:46 +02:00
ericdrowell
f5d4228f3b removed load() method from stage. Added Kinetic.Node.create() which creates a node from a json string. This essentially allows us to deserialize any node, including a stage, layers, groups, and shapes. 2012-10-03 20:38:29 -07:00