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
ericdrowell
fcd4b345fc
moved cornerRadius proprty to Shape level
2012-10-06 15:55:10 -07:00
ericdrowell
e16935efb3
merge pull request #115 which improves get() design, and also enables the ability to select by node ttype
2012-10-06 15:40:49 -07:00
ericdrowell
82bfd9c15a
text shadows now work correctly again
2012-10-06 15:19:33 -07:00
ericdrowell
a3840fdc69
moved line cap logic to shape level so that Path can also utilize line caps
2012-10-06 15:05:03 -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
6f230fc42b
pull request #109 opacity can now be applied to the stage
2012-10-06 13:53:50 -07:00
ericdrowell
3f8801a494
setZIndex now correctly reorders layer canvases
2012-10-05 18:59:03 -07: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
ericdrowell
a97d3ad01f
refactored toJSON() method to work for any node, not just the stage. Improved the OO design following David Johanssons lead, and also added another unit test
2012-10-03 19:38:12 -07:00
David Johansson
fa2c8fb88d
Off can remove all listeners in the same name space by .off(".foobar")
2012-10-04 00:50:04 +02:00
ericdrowell
9ba21651a9
fixed typo
2012-10-03 10:58:52 -07:00
ericdrowell
b6eb2cdf82
added mouseenter and mouseleave events. mouseover and mouseout were actually functioning like mouseenter and mouseleave. mouseover and mouseout now work similar to traditional DOM mouseover and mouseout. This change enables event delegation to work correctly
2012-10-03 10:53:09 -07:00
ericdrowell
c6237b59e6
fix #93 readded layer isListening and isVisible logic
2012-10-03 00:04:56 -07:00
ericdrowell
0eff286243
fix #93 rather than detecting if a layer is listening or visible, I think it's cleaner to hide and show the buffer canvas along with the scene canvas inside the setVisible method
2012-10-02 23:33:53 -07:00
ericdrowell
8cd47db046
fix #93 layer children were still detecting events even when layers were hidden
2012-10-02 23:12:49 -07:00
David Johansson
73bf805483
Made getAbsoluteOpacity work recursively. Also added support for stage opacity (included test).
2012-10-01 00:55:12 +02:00
ericdrowell
759ec116ce
fixed up unit serialization tests. cleaned up constructor jsdoc comments. fixed Ellipse setRadius method
2012-09-26 20:28:20 -07:00
ericdrowell
f235ea032d
improved OO design for remove() and add()
2012-09-26 19:26:53 -07:00
ericdrowell
0a8f0ddb74
got really tired of doing node.getParent().remove(node). To remove a node, you now just do node.remove().
...
I realize that this doesn't follow the JavaScript pattern of
parent.remove(child), and that from an OO perspective, perhaps nodes
shouldn't have the ability to destroy themselves. But, from a
practical standpoint, it's a heck of a lot more convenient to just use
.remove() when you want to remove something.
2012-09-26 12:50:08 -07:00
ericdrowell
900f02f912
merged pull request #65 and updated manual tests. Also removed dragConstraint and dragBounds as they are now redundant. I may introduce a set of dragBounds helper functions, similar to filters, that provide common functions out of the box, such as Horizontal and Vertical
2012-09-25 21:23:35 -07:00
ericdrowell
b757342b11
cleaned up isAncestorOf logic. stage should not be an ancestor of self. plus this was bad OO design
2012-09-25 16:30:13 -07:00
ericdrowell
2b99a88b7e
merge pull request #106
2012-09-25 16:15:00 -07:00
ericdrowell
8fdab12e96
merge pull request #102
2012-09-25 16:07:28 -07:00
ericdrowell
d4734ba33a
created _getFillType utility to help manage fill type objects. You can now dynamically switch between different fill types, including colors, linear gradients, radial gradients, and patterns
2012-09-25 15:57:57 -07:00
ericdrowell
ff926b34af
in addition to Collection each() and apply(), I wanted to make it easier to attach event listeners to node collections, so I went with David Johansson's approach for whitelisting on() and off().
...
The difference now is that the on() and off() methods are dynamically
added to the Collections prototype from Node, which acts as a wrapper
around each()
2012-09-25 13:38:36 -07:00
ericdrowell
d522b9d9d0
now that the attrs engine has been rewritten, we can cleanly hide and show the layer canvas whenever the layer is hidden or shown via instantiation or with setters. Also improved layer hide and show unit test
2012-09-25 12:22:22 -07:00
ericdrowell
74bef1e108
unrecognized selector should return an empty array. also formatted unit tests
2012-09-25 12:12:27 -07:00
ericdrowell
9bfe5f5e52
refactored get() method
2012-09-25 12:06:02 -07:00
ericdrowell
8b5013c393
adding empty dist files
2012-09-25 11:20:35 -07:00
ericdrowell
366849e64e
removing dist files
2012-09-25 11:14:15 -07:00
David Johansson
869e420099
Corrected Kinetic.Path.getPointOnLine() to work in negative x direction. Including Unit test.
2012-09-25 08:56:15 +02:00
ericdrowell
90ba0d9a78
merged with latest trunk
2012-09-24 20:36:54 -07:00
ericdrowell
0353214fb6
first pass at rewriting the setAttrs logic in Node. In order to have a cleaner OO design, the data type logic needs to exist within each respective module, such that the setter methods are the source of truth.
...
the setAttrs method now simply calls setter methods. Also added _clone
and _merge utility methods in Type. The refactor greatly improves
decoupling and will enable much cleaner OO design in the near future.
2012-09-24 20:34:23 -07:00
David Johansson
16c7cd2708
Re-added Kinetic.Collection to _getNodes and a test confirming its necessity.
2012-09-24 22:31:06 +02:00
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
David Johansson
2c937362b7
Fix for TextPath shadow. SHadow was only added for first character.
2012-09-24 19:35:11 +02:00
ericdrowell
a349fa488c
fix #96 setting text to integer data types no longer fails
2012-09-23 18:41:05 -07:00
ericdrowell
24e3aa2c03
added isListening and isDraggable aliases for consistency
2012-09-23 16:06:44 -07:00
ericdrowell
bda7f9f082
no reason to use a Kinetic.Collection inside _getNodes because the elements are pushed into a collection outside of _getNodes
2012-09-23 15:47:15 -07:00
David Johansson
a8cacb28e3
Merge remote-tracking branch 'upstream/master' into custom-dragBounds
2012-09-24 00:16:43 +02:00
David Johansson
45d61a0eb6
Corrected behaviour of the collections apply method.
...
Changed collections each-method to use same syntax as jQuery - function(index, element) and also being able to use 'this' to get the element.
Added test for apply('on',...) since it needs more than one argument.
2012-09-24 00:05:34 +02:00
ericdrowell
9f5d0fe351
created Collection class to handle iterating over arrays returned from get()
2012-09-23 10:53:23 -07:00
ericdrowell
8d6103d1e0
get() now returns a Node.Array array which has node methods. This means that you can do stuff like layer.get('.shape').setX(300)
2012-09-22 21:27:44 -07:00
Eric Rowell
d0a1b2870e
when calling layer.hide() or show(), the physical canvas element is hidden and shown rather than clearing and redrawing the layer. This greatly improves hide and show performance for layers
2012-09-18 09:25:16 -07:00
Eric Rowell
0f2cee5499
merged davonium's pull request which enables deep cloning
2012-09-17 23:20:23 -07:00
Eric Rowell
01c2b28a6c
it turns out that there was only a problem with moveDown. refactored logic proposed by Adam
2012-09-17 22:49:24 -07:00
David Johansson
580e52689c
Deep cloning. Cloning also clones children. Also added unit test to confirm that it's working as expected.
2012-09-02 23:44:00 +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