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
047e26382e
added new wedge shape. cleaned up shape comments. added degToRad and radToDeg helper in Type utility
2012-11-29 20:15:01 -08:00
Eric Rowell
0e6eb3ffe4
fixed up some text shadow issues
2012-11-24 09:15:02 -08:00
Eric Rowell
b67cc4b589
Text shape now depends on Rect for rect drawing func
2012-11-23 22:21:19 -08:00
Eric Rowell
318d03feb7
finished up new Scene and Hit Renderers. added new textShadow attrs for more flexibility. Added new fillStroke() method which encapsulates shadow application logic
2012-11-23 14:54:32 -08:00
Eric Rowell
144e95ad42
preparation work for new Renderer inheritance pattern
2012-11-20 23:03:24 -08:00
Eric Rowell
c121e4b941
you can now pass in custom drawFuncs and drawHitFuncs via shape constructors
2012-11-18 20:28:55 -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
d636afb6fe
text.getWidth() and getHeight() now return calculated width and height. Removed getBoxWidth() and getBoxHeight() methods
2012-10-11 20:00:13 -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
b025767a27
updated jsdocs. TextPath setText() now calls Text setText(). Polygon setPoints() method now has data conversion logic similar to Line
2012-10-07 21:12:45 -07:00
ericdrowell
82bfd9c15a
text shadows now work correctly again
2012-10-06 15:19:33 -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
Eric Rowell
1de5bce6e5
multi line text now correctly supports shadows
2012-08-26 18:49:05 -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
ed8c5ab6b8
changing the font size now correctly updates the text data
2012-07-31 21:13:25 -07:00
Eric Rowell
9631d6e1bb
split up methods from the PathHelper class and moved them to Path and Geometry. Path specific methods went to Path, and general purpose geometric utility methods went to the Geometry utility class. TextPath now inherits methods from Path
2012-07-28 16:08:14 -07:00
Eric Rowell
c4a359cd48
moved drawFunc definition out of the shape initializers as a method to improve space performance
2012-07-28 10:46:16 -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
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
d0f37f7c88
rewrote text array algo in Text. added newline support. now handling edge case in which the text box width is smaller than a character width. if a line is not able to wrap via space or dash, the word itself is wrapped.
2012-07-08 13:59:43 -07:00
Eric Rowell
a8ab9a2533
implemented clone method (inspired by matteo78) and added thorough unit tests
2012-07-07 14:43:12 -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
3e0ed1c2fb
fixed up logical error in Text shape
2012-07-01 17:14:15 -07:00
Eric Rowell
66f29c602e
added padding attr change event binding to Text
2012-07-01 17:08:59 -07:00
Eric Rowell
6e3bae6b2d
fixed typo introduced with search/replace
2012-07-01 16:29:15 -07:00
Eric Rowell
4c521317ff
Text shape is no longer a group made up of a Rect and Shape. The complexity overhead out-weighs the inelgance of duplicating a dozen lines of the Rect shape.
2012-07-01 16:25:02 -07:00
Eric Rowell
aa4b0955c0
added horizontal align logic back into the Text draw func
2012-06-30 20:05:27 -07:00
Eric Rowell
e279ea30b9
fixed up new Text wrap edge cases. Will add a bunch of unit tests soon
2012-06-30 19:43:52 -07:00
Eric Rowell
6663b9e612
first pass at implementing auto word wrap. Still have a few edge cases to cover. Removed vertical align property as it is no longer relevant
2012-06-30 00:40:54 -07:00
Eric Rowell
07ef653441
completely rewrote the Text shape. Kinetic.Text is now a Group that's composed of a Rect and a custom shape that draws text. align and vertical align now apply to the text alignment inside the text box. box rounded corners are now possible since Text uses Rect. Shadow logic improved. Beefed up the text getter and setter unit tests
2012-06-27 19:50:32 -07:00
Eric Rowell
c1a08d8073
created new addSettersGetters method, further enhanced dynamic getters and setters
2012-06-23 18:09:10 -07:00
Eric Rowell
19750782c7
improved drawing speed by 7% by optimizing stroke(), fill(), and several other methods
2012-06-22 19:36:37 -07:00
Eric Rowell
9b76f650f7
exposed content event bindings so that we can simulate mouse and touch events for the purpose of internal and external functional tests
2012-06-14 23:46:52 -07:00
Eric Rowell
73ad904de6
updated jsdocs
2012-06-14 02:19:51 -07:00
Eric Rowell
6d4738cd2b
all simple getters and setters are now dynamically created. This is the first step towards creating a code base that can unpack at run time to reduce file size
2012-06-10 13:07:09 -07:00
Eric Rowell
6b70e1b18f
now using setAttrs for all Shape and shapes setters
2012-06-10 00:02:16 -07:00
Eric Rowell
1b333bc800
new simulate() method to simulate node events. e.g. shape.simulate('click')
2012-06-02 00:21:49 -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
4ba2818f97
improved shadow code quality and added support for text fill and stroke shadows
2012-05-20 10:47:28 -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
ericdrowell
4b1403f7fe
Merge pull request #20 from matthieu-ravey/master
...
Adding the maxWidth property to the Text Shape
2012-05-12 15:49:48 -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
Matthieu Ravey
cd276169d7
Adding maxWidth support for fillText and strokeText
2012-05-10 11:15:29 +02: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
a27741ce03
added shadow support. changed fillStroke method to shadowFillStroke
2012-05-08 23:06:13 -07:00
Eric Rowell
8dce92c2fd
introduced new setDefaultAttrs() method which greatly simplifies the logic required inside node constructors. This will also make plugin creation much easier
2012-04-28 12:55:18 -07:00