Commit graph

117 commits

Author SHA1 Message Date
kangax
fe37bc66a0 fabric.Element#loadImageFromURL no longer displays image that's being loaded. Fix getPointer unit test. 2011-05-11 18:58:51 -04:00
kangax
3ea4a4ad95 Fix majority of failing unit tests. 2011-05-11 18:17:21 -04:00
kangax
1f0b1280d4 Add unit tests for fabric.Object#selectable; make sure "selectable" is part of toJSON/toObject output. Fix failing fabric.Object unit tests. 2011-05-11 17:48:43 -04:00
kangax
79e37bbf30 Add fabric.Object#selectable Boolean property (true by default), which can be used to control object selection. 2011-05-11 15:56:49 -04:00
kangax
a7f7bdaf80 Make _removeDefaultValues more flexible. 2011-05-10 16:41:51 -04:00
kangax
14e988aa9f lockScaling constrain is now broken into lockScalingX and lockScalingY ones. Add lockUniScaling to be able to prevent non-proportional scaling of an object. lockHorizontally is now lockMovementX and lockVertically is now lockMovementY for consistency. Change demo accordingly. 2011-05-05 17:02:46 -04:00
kangax
5c7440cc13 Fix leaking of one element's attribute values onto another (following) element during SVG parsing. 2011-04-29 16:44:49 -04:00
kangax
74dcd851dd Animation benchmark now allows to dynamically change scale of animated objects, load different shapes, and change canvas size. This allows us to see how all these aspects (e.g. canvas size or shape size) influence canvas rendering performance. 2011-04-23 17:39:56 -04:00
kangax
e61f46b44c Add "lineHeight" to fabric.Text options. Add slider to control line height of selected text to demo. 2011-04-20 16:36:31 -04:00
kangax
a29aa82518 Add experimental clipping support. 2011-04-11 02:41:55 -04:00
kangax
cc0c5085d7 Add fabric.Circle#getRadiusX, fabric.Circle#getRadiusY methods. 2011-04-09 17:37:35 -04:00
kangax
752eff298d Few small IE fixes. 2011-03-29 13:27:28 -04:00
kangax
9853b4a18f Add rudimentary support for stroke style. Fix IE errors on a demo page. 2011-03-28 18:57:40 -04:00
kangax
91205b4bb6 More text enhancements and fixes. Demo page now has italic/underline/overline/line-through and shadow buttons for text manipulations. 2011-03-21 17:24:36 -04:00
kangax
b60edcc379 Much more usable multiline text. 2011-03-21 03:53:23 -04:00
kangax
4046084994 Revamp canvas initialization (now simpler, more maintainable, and makes more sense after removing old cruft). Bump version to 0.2. Back. compat warning: wrapping canvas container now has a "canvas-container" class instead of "canvas_container" (the actual class name can also be changed via fabric.Element#CONTAINER_CLASS); canvas background element is no longer created (as it wasn't really used). 2011-03-17 17:59:52 -04:00
kangax
9bf3e71ced When free-drawing, do not create paths with 0 width/height, as they are rendered inconsistently across different browsers. 2011-03-01 19:27:40 -05:00
kangax
dd4f178389 Allow options with falsy values (e.g. 0 or "") 2011-03-01 19:26:24 -05:00
kangax
3340173e60 Simplify _initStateProperties in fabric.Text 2011-03-01 19:08:38 -05:00
kangax
e7e19c2247 Add fabric.util.stopObservingEvent. Needs tests. 2011-03-01 19:06:56 -05:00
kangax
03561f762f Add "rx", "ry" to the stateProperties of fabric.Rect. Fixes issue #16. 2011-03-01 19:06:27 -05:00
kangax
77ed374671 Fix deltaY undeclared variable. 2011-03-01 19:05:46 -05:00
kangax
d9828321ca Fix text rendering in IE9. Now fully works! Fix fabric.Element#insertAt not calling setCoords and setupState on added object. This was affecting fabric.Element#loadFromJSON. Thanks vepkenez for bringing it up. 2011-02-17 16:41:16 -05:00
kangax
ef425d18c5 Fix some of the parser.js unit tests by making resolveGradients more lenient. 2011-02-11 01:44:08 -05:00
kangax
7e6b615601 Fix simple shapes test. Make sure objects' coords are set even when fabric.Element#stateful is false. 2011-02-09 18:40:38 -05:00
kangax
df76f5d688 Change the way options are set for an object (don't use options property — which makes for quite expensive iteration during initialization — and instead take advantage of prototypal inheritance). 2011-02-09 18:21:45 -05:00
kangax
2ade9dc0f8 More optimizations: setCoords doesn't need to be invoked on an object before it's added to canvas. This makes most sense when creating path groups, since each of the paths in a path group doesn't really need to have coords. Coords are used to determine object boundaries when moving/scaling/rotating objects, and paths in pathgroup never participate in it (instead, pathgroup does). 2011-02-09 17:30:35 -05:00
kangax
45c9a333a8 Few optimizations in _parsePath implementation. 2011-02-09 16:35:46 -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
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
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
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
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
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
580c0680f0 First stab at parsing + applying css rules to SVG elements. Needs unit tests! 2011-01-19 02:30:35 -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
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
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
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
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
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