Commit graph

166 commits

Author SHA1 Message Date
kangax
83d1d7cecf Uncomment raphael test in complex_shape_2. 2011-02-09 01:04:31 -05:00
kangax
ca11620451 Replace map with for loop for perf. reasons (as this method is likely to be called thousands of times). 2011-02-09 01:03:04 -05:00
kangax
afb841e085 Add another complex shape (~9K paths) to the raphael vs. fabric perf suite. 2011-02-09 00:41:27 -05:00
kangax
ba4486e5be Use Array.prototype.slice to convert nodelist to an array (slice is usually faster; it makes sense in this context where nodelists (i.e. shapes) could consist of thousands of elements). 2011-02-09 00:14:12 -05:00
kangax
550bb5da3d Remove debugger leftover from gradient.js. 2011-02-06 23:25:19 -05:00
kangax
4d86890b68 Few tweaks to raphael vs fabric tests. 2011-02-06 04:28:04 -05:00
kangax
7e395b9a85 Few tests comparing performance of fabric vs Raphael. 2011-02-06 04:10:08 -05:00
kangax
fef2fd4666 Experiment with multiline text (incomplete; need to properly determine height of the bounding box). 2011-02-06 04:09:40 -05:00
kangax
263206a7a0 Remove remaining pieces of Prototype.js 2011-02-06 04:06:40 -05:00
kangax
da6b00fc0e Introduce fabric.Element#stateful and fabric.Element#renderOnAddition options, as a way to improve performance. Note that setting "renderOnAddition" to false could give a pretty significant performance boost when adding a lot of objects to canvas at once, since fabric.Element#add would not re-render canvas on each addition. Once added, the canvas should be re-rendered manually, via renderAll method. 2011-02-06 02:58:32 -05:00
kangax
848f7990b4 Add few more SVG files (for use in a demo). 2011-02-01 19:58:48 -05:00
kangax
bb4aad1de5 Modify cufon and text class to support textDecoration (underline/overline), fontStyle (italic), and textShadow (any valid CSS value). 2011-02-01 19:57:01 -05:00
kangax
fcbe708c5c Enable color and opacity controls only when something is selected on canvas. 2011-01-30 18:37:02 -05:00
kangax
17c6817bf3 Add native colorpicker (<input type=color>) when available. Note that Chrome produces false positive; doesn't expose actual colorpicker control. 2011-01-30 18:29:30 -05:00
kangax
bf8bb679f7 Remove an assignment that was used for debugging. 2011-01-23 03:42:17 -05:00
kangax
0dae843114 Revamp object corner detection logic (now, finally, corners are detected properly). 2011-01-23 03:30:22 -05:00
kangax
d54ac51445 Move gradient shape in the demo to the top of the shapes list (where other 1-path shapes are). 2011-01-20 01:44:23 -05:00
kangax
6e8810d791 Gradient color stops can now be parsed from style attribute of <stop> elements (which are children of <gradient> elements). Fix gradient rendering logic, where rendering point would originate from center of the shape, instead of a proper top/left corner. Add 2 more example gradients to the demo page. 2011-01-20 01:42:00 -05:00
kangax
0570d6f825 Add missing assets 2011-01-19 02:32:49 -05:00
kangax
580c0680f0 First stab at parsing + applying css rules to SVG elements. Needs unit tests! 2011-01-19 02:30:35 -05:00
kangax
1acbb04036 Add more demo shapes, including HTML5 logo. Make gradientify button enabled only when there's an active object. 2011-01-18 18:55:46 -05:00
kangax
b35ebd0bb2 Reorganize SVG gradients parsing in such way so that during parsing, objects (to apply those gradients to) were available; we need this to be able to apply percent-based values properly (e.g. x2="100%" should be translated to an object's width, y2="50%" -- to object's height / 2, etc.). 2011-01-09 02:09:28 -05:00
kangax
a40e9cd610 Initial implementation of gradients. Work in progress (but demo page now has working "gradientify" button). Still need to add tests, and make sure gradient-based fills on SVG elements are parsed/set properly. 2011-01-09 01:38:54 -05:00
kangax
6fa84aba5e Add more shapes to the demo (all except few render properly). 2011-01-09 01:37:04 -05:00
kangax
80148361f3 Add support for parsing <image> SVG elements and creating fabric.Image instances out of them. Backwards-compatibility note: fabric.parseElements changed signature from (elements, options) to (elements, callback, options) and is now an "asynchronous" method -- doesn't return a value, but instead passes it to a callback function (second argument). 2011-01-07 19:53:19 -05:00
kangax
1a84c912d9 Add few more shapes to the demo page 2011-01-07 02:13:44 -05:00
kangax
fdfb61fd48 Make it possible to delete object/group with "delete" key. 2011-01-07 02:12:41 -05:00
kangax
2eea8d4468 Fix style attribute parsing + tests. Add one more shape to the demo (which utilizes style attribute). 2011-01-06 17:13:07 -05:00
kangax
19a82b2b50 Add test for elements inside <defs> being ignored. 2011-01-06 15:38:20 -05:00
kangax
b550020024 Elements that are descendants of <defs> elements are no longer rendered (as per spec). 2011-01-06 15:20:56 -05:00
kangax
d5a82f3fd9 Make sure straight lines are rendered. 2010-12-25 21:48:48 -05:00
kangax
661ea4de04 "text" property of text objects should be a "state property" (used in undo/redo management). 2010-12-25 21:48:42 -05:00
kangax
cc9d469b81 fabric.Element#remove should clear active object if it's active object that's being removed. 2010-12-25 21:45:30 -05:00
kangax
773fe2bc55 Only activate guidelines in demo when url query has specific parameter. 2010-10-31 23:57:59 -04:00
kangax
33278ae20b Reorganize fabric.Element in such way so that centering and aligning guidelines could work together.
`fabric.Element#onObjectMove` callback is gone, replaced by "object:moved" event (which allows subscription to the event by multiple parties).
Similarly, `fabric.Element#onMouseUp` is replaced with "mouse:up" event, and `fabric.Element#afterRender` with "after:render" one.
The drawback of these events, as of now, is that it's not possible to determine which canvas instance fired which event --
in case of multiple canvas instances in a document, this could get hairy. Will probably fix it by introducing some kind of `Observable` mixin,
which would add "observe" and "fire" methods to `fabric.Element` itself.
2010-10-31 22:42:20 -04:00
kangax
33467d15a2 First (crooked and incomplete) implementation of aligning guidelines. 2010-10-31 01:28:54 -04:00
kangax
45795824ac First stab at centering guidelines and snapping to a center (vertical/horizontal). 2010-10-30 21:47:15 -04:00
kangax
f497327131 Fabric now runs fully under ES5 strict mode (except certain 3rd party dependencies, like cufon.js and json2.js). 2010-10-21 22:54:00 -04:00
kangax
948d3998c8 A couple more doc fixes and build distribution + minified. 2010-10-19 16:31:39 -04:00
kangax
f052a067ef More documentation. 2010-10-19 16:27:24 -04:00
kangax
f281be8a38 Use "codeview" template for docs. Link to documentation in README. 2010-10-15 13:26:08 -04:00
kangax
33e929053e More documentation. 2010-10-15 12:55:53 -04:00
kangax
2d1d0d80e5 Add jsdoc-toolkit and generate docs. 2010-10-15 12:11:37 -04:00
kangax
588c422bbb Give demo text random angle and slightly better random positioning. 2010-10-15 00:59:41 -04:00
kangax
2f168d05a9 Add few sample fonts and cufon.js (which is a dependency for fabric.Text). 2010-10-15 00:56:54 -04:00
kangax
639aa12e2a Another chunk of documentation (which is a bitch, by the way). 2010-10-14 22:16:24 -04:00
kangax
415205d3f2 Document bunch of API (still incomplete, but getting there). 2010-10-14 17:42:39 -04:00
kangax
e70830f7d6 Introduce fabric.log and fabric.warn methods, as simple wrappers around console.log and console.warn (instead of declaring those methods right on console). This makes it easier to mock them when testing, and is generally safer due to less tinkering with host objects. 2010-10-11 14:45:06 -04:00
kangax
8ceca73561 Recalculate offset after adding shape to canvas on demo page (otherwise, FF4 is bugging out for some strange reason). 2010-09-22 18:32:02 -04:00
kangax
c97a41a514 Fix bug on demo page, when requests weren't made. 2010-09-22 18:23:05 -04:00