Commit Graph

89 Commits

Author SHA1 Message Date
Eric Rowell
8f06f1eb67 heavily updated documentation 2013-05-07 10:19:54 -07:00
Eric Rowell
58b081ef12 fixed a couple bugs introduced with transform matrix caching. Cleaned up addPointGetterSetter API. reorganized dynamic getter setter comments so that it's easier to keep track of them 2013-05-02 10:22:21 -07:00
Louis Jolibois
14dc481eee Merge github.com:ericdrowell/KineticJS 2013-03-27 18:55:52 +01:00
Louis Jolibois
823529f839 Fixed word wrapping behavior: last words of a multiline text should not be arbitrarily wrapped anymore.
Fixed width padding not being used.
Removed unused _expandTextData method
2013-03-27 17:12:20 +01:00
Eric Rowell
46c7b89e06 created new test method, testDataUrl, which makes it super easy to identify data url comparison failures that resulted from Chrome upgrades. Begain integrating. fixed all synchronous unit test data url comparison failures 2013-03-24 14:12:00 -07:00
Eric Rowell
5b3a87b98d changed wrapping attribute to wrap 2013-03-20 09:26:55 -07:00
Eric Rowell
809da97a45 merged and tweaked pull request 314 2013-03-20 09:17:21 -07:00
Eric Rowell
821aa7b872 Merge pull request #307 from Turbo87/patch-1
Text: Fixed DASH constant
2013-03-19 10:29:09 -07:00
Eric Rowell
0073c4cbb9 TextPath now uses Text to build the context.font value for consistency and code reuse. Type._getRandomColorKey now uses an or bitwise operation to round rgb values much faster 2013-03-19 10:17:09 -07:00
Eric Rowell
e43c2fbeb4 fixed logic in Text that was accessing padding attr directly without using the getter 2013-03-17 21:16:08 -07:00
Eric Rowell
8e17729cea first pass of new Label plugin 2013-03-15 23:35:40 -07:00
Eric Rowell
69f9374c8e first pass at removing setDefaultAttrs logic to speed up node instantation performance 2013-03-15 08:33:05 -07:00
Louis Jolibois
c58db11a2a refactored the whole _setTextData method of Kinetic.Text, added a 'wrapping' option.
Performances should improve.
Also, the text should not overflow anymore from the defined width like it sometimes did.
2013-03-15 15:40:30 +01:00
Louis Jolibois
5ca21992de Added a shared cached dummy canvas context that may be used by Kinetic.Text methods.
This greatly improves performances when creating lots of Kinetic.Text nodes, especially on mobile devices.
2013-03-14 19:34:35 +01:00
Tobias Bieniek
ac1578b6c6 Text: Fixed DASH constant
The DASH constant should obviously contain a dash instead of a newline character. I guess this was caused by a copy-paste error...
2013-03-08 11:57:31 +01:00
Eric Rowell
5d3180aee5 added text metric caching to improve text drawing performance a bit 2013-02-10 17:36:47 -08:00
Eric Rowell
c9b99a9131 Kinetic.Text code cleanup 2013-02-10 15:42:48 -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
c2e5f4c1b3 refactored stroke and fill logic to eliminate duplicated logic 2013-01-24 22:44:00 -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
522607695f Text fontSize unit is now in pixels (used to be points). Default text lineHeight attr is now 1 (used to be 1.2) 2013-01-01 19:36:13 -08:00
Eric Rowell
e9d56dafba added new Blob shape. removed double quotes from all shapes. made it easier for shapes to extend other shapes 2013-01-01 00:41:13 -08:00
Eric Rowell
7cb4c4269f huge changes to Text shape. Skinnied it up by removing rectangle rendering component. textFill is now fill, textStroke is now stroke, textShadow is now shadow, and textStrokeWidth is now strokeWidth 2012-12-31 12:45:32 -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
f18bf604de added pixel ratio optimization to sharpen renderings for devices with a pixel ratio > 1 2012-12-13 21:53:39 -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
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