kangax
89cdfa3884
Merge remote-tracking branch 'Kingsquare/master'
2012-02-05 13:18:22 -05:00
kangax
13049361b0
Preserve image src for use in node.js. Add support for overriding src of images when exporting to SVG.
2012-02-03 23:27:45 -05:00
Tim de Koning
c31e519bd2
Fixed SVG new line issues in IE7 and IE8
2012-02-03 18:13:08 +01:00
kangax
19dbb74307
Fix trailing commas. Closes #118 .
2012-02-03 09:18:35 -05:00
kangax
e9dee5a37d
Make SVG export of text more reliable (rgba()-based colors now work in Illustrator). Cut off decimal parts of values in SVG output, which slims down the size.
2012-02-01 18:43:52 -05:00
kangax
6ce924b38d
Use a fork of "o3-xml" package that allows to run under latest Node.js 0.6.8. Note that SVG parsing doesn't work when running under latest Node. Here's why — https://github.com/ajaxorg/node-o3-xml/issues/23#issuecomment-3705238
2012-01-29 12:30:39 -05:00
Gregory Burlet
29e128faa0
variable name changes
...
changed backgroundOpacity to backgroundImageOpacity etc.
2012-01-27 09:19:40 -05:00
kangax
3d6ae8442f
Fix object controls not working in IE8. Closes #92 .
2012-01-26 19:39:30 -05:00
Gregory Burlet
78c2345bb8
added options for setBackgroundImage
...
optional arguments to the function can be supplied
2012-01-23 12:20:34 -05:00
Gregory Burlet
136539f9d9
background image changes
...
Allow the user to set the background image opacity, and whether the image should be stretched to fit the canvas
2012-01-23 11:48:37 -05:00
Juriy Zaytsev
c57791e633
Merge pull request #105 from Kingsquare/master
...
Fix unit tests in < IE8.
2012-01-23 05:15:56 -08:00
kangax
0bb80dddf0
Fix fabric.Canvas#setOverlayImage('') not removing overlay image.
2012-01-21 23:07:16 -05:00
kangax
4565e0dd6a
Fix parsing of gradients with stops that have absolute values (rather than percents).
2012-01-21 13:33:49 -05:00
kangax
c057b8b6d5
Fix vertical gradient rendering. Closes #108 . Thanks aarr0n.
2012-01-21 12:59:30 -05:00
Tim de Koning
804de6094c
Why shouldn't we allow GET parameters? Dynamicly generated SVG files (based on GET params) should be supported to
2012-01-20 11:29:51 +01:00
Tim de Koning
c34bc926ed
Fir fox IE7 and IE8 multiline strings
...
IE7 and IE8 are the only browsers to strip newlines and spaces in the DOM tree. This is an ugly fix to work around this issue and make mulitline strings possible in IE.
2012-01-18 15:36:17 +01:00
Tim de Koning
2fab0b1ed7
Font rendering fix for < IE9
...
Fabric expects text to be rendered as Canvas elements. Cufon however falls back to VML rendering when canvas is not available in the browser. This mod of the Cufon library ALWAYS enabled the canvas rendering engine for Cufon. This way font-rendering is available on IE7 and IE8 when excanvas is available.
2012-01-18 12:00:59 +01:00
Tim de Koning
f71f634afd
IE8 and lower now actually render and show any loaded SVG
2012-01-18 10:44:03 +01:00
Tim de Koning
3795149dda
Allow excanvas to kick in for IE8 and lower
2012-01-18 10:01:34 +01:00
Tim de Koning
364e76713c
fabric.loadSVGFromString should work on IE8 and lower...
2012-01-17 17:29:45 +01:00
Tim de Koning
da9c75c073
improved doctype removal regex
2012-01-17 16:30:23 +01:00
Tim de Koning
17931fb764
fix for unittest "fabric.Parser.parseStyleAttribute" compliance in < IE8
2012-01-17 15:24:25 +01:00
Tim de Koning
26d6176928
fix for unittest fabric.util.loadSVGFromString in < IE8
2012-01-17 14:41:58 +01:00
kangax
1c8b5c122d
Avoid sub-pixel antialiasing when drawing straight vertical or horizontal lines.
2012-01-15 12:46:52 -05:00
kangax
23c4ec2068
[BACK_INCOMPAT] Remove fabric.Object#getCenter as it doesn't make sense (getLeft/getTop already return object center coordinates).
2012-01-10 14:16:16 -05:00
kangax
de8684cfda
Fix text shadow rendering in exported SVG.
2012-01-06 19:58:21 -05:00
kangax
e20a37ba6a
Add fabric.Image.filters.Invert (thanks Travis Paul).
2012-01-05 17:38:35 -05:00
kangax
c451f32c9f
Fix text alignment in SVG export. Center- and right-aligned text now displays properly. Add more tests to SVG export test suite.
2012-01-04 17:18:42 -05:00
kangax
9814cf12b5
Add support for text background color in SVG representation.
2012-01-04 12:31:37 -05:00
kangax
d870410a7d
First (and almost complete) implementation of fabric.Canvas#toSVG.
2012-01-02 16:14:20 -05:00
kangax
3544410689
Fix bug in canvas initialization in node. Thanks Urs.
2011-12-10 13:26:52 -05:00
kangax
cb7a4bdf86
Remove reference to window in util/misc.js for node compat.
2011-12-09 16:24:37 -05:00
kangax
326d662eec
Fix JS error in older browsers (e.g. FF4) when fabric.Rect's x/y are undefined. Closes #84 . Thanks Kienz.
2011-12-08 10:31:30 -05:00
kangax
d72fceb14b
Documentation tweaks.
2011-12-08 09:44:05 -05:00
kangax
a8758ffbe1
Use requestAnimFrame polyfill instead of setInterval in fabric.util.animate. Add fabric.util.requestAnimFrame.
2011-12-08 09:44:05 -05:00
kangax
ea99a1fc7c
Pass actual event when firing synthetic "object:selected" one.
2011-12-05 12:55:31 -05:00
jarek
f4a9a7719e
Merge remote-tracking branch 'upstream/master'
2011-12-02 09:53:33 +01:00
kangax
eb9d64f89a
Fix Opera <12 bug with canvas not getting correct prototype.
2011-11-28 19:47:41 -05:00
kangax
b8ea6b7cec
[BACK_INCOMPAT] Add support for static canvases — fabric.StaticCanvas. fabric.Canvas#loadImageFromURL -> fabric.util.loadImage. Add fabric.Canvas#centerObject.
2011-11-27 23:57:28 -05:00
jarek
f8045a84b9
fixed problem with drawing text object with non default fontWeight
2011-11-24 12:44:00 +01:00
kangax
6d376dd588
Fix gradient positioning in fabric.Gradient.forObject.
2011-11-20 12:34:36 -05:00
kangax
f3a3e81ea2
[BACK_INCOMPAT] Fix JS error when calling fabric.Image#toDataURL. toDataURL is now asynchronous, and passes data url to callback (first argument) instead of returning it. Closes #79 .
2011-11-18 10:44:53 -05:00
kangax
aff78a0d1d
Fix wrong opacity setting in fabric.Color. (thanks Javier Valero)
2011-11-14 15:10:35 -05:00
kangax
7adb4309de
Add support for customizing canvas default cursor.
2011-11-11 15:01:20 -05:00
kangax
343a5a2605
Add fabric.util.makeElementSelectable (the opposite of makeElementUnselectable).
2011-11-08 12:35:20 -05:00
kangax
2e42f9bd9d
fabric.Image#setElement now updates instance' width/height properly.
2011-11-03 18:12:53 -04:00
kangax
d16e166e54
Fix element replacement in applyFilters (when no filters are present).
2011-11-02 17:25:20 -04:00
Diogo Campos
a8166b355b
Remove unnecessary test in fabric.util.animate
2011-10-29 17:04:20 -02:00
kangax
ae9025ce5c
Fix image filter initialization in node.
2011-10-29 14:36:09 -04:00
kangax
d226102fbb
Make fabric.Image#applyFilters work in node.
2011-10-29 14:11:44 -04:00
kangax
6c463afda5
Fix fabric.Canvas#backgroundImage bug.
2011-10-28 17:10:01 -04:00
kangax
94db7bfc8f
fabric.Image.GrayscaleFilter --> fabric.Image.filters.Grayscale as per users request; Make image filters serializable.
2011-10-27 20:06:19 -04:00
kangax
ea0da5a987
Make sure fabric.Image#filters can be a sparse array.
2011-10-26 20:03:51 -04:00
kangax
1a8b82b8e3
[BACK_INCOMPAT] Add support for image filters. Add fabric.Image.GrayscaleFilter and fabric.Image.RemoveWhiteFilter "classes". Filters should be used by adding them to filters array of image instances. For example, myImage.filters = [ new fabric.Image.GrayscaleFilter(), new fabric.Image.RemoveWhiteFilter({ threshold: 30, distance: 50 }) ].
2011-10-26 01:34:54 -04:00
kangax
fe03bf19d5
Fix broken fabric.Text#textDecoration.
2011-10-16 12:53:37 -04:00
Jhonny Everson
40edcb8e8b
fontSize not being used from options in fabric.Text
2011-09-30 07:46:41 -03:00
kangax
2b08618742
Fire "object:scaling" and "object:rotating" events.
2011-09-29 09:31:57 -04:00
kangax
36aeed700a
[BACK_INCOMPAT] fabric.Canvas#selection boolean property now only affects _group_ selection (i.e. blue area that allows to select multiple objects no longer appears). Objects can still be selected by clicking on them. To make _everything unselectable_ — set "selectable" property of each object to false AND fabric.Canvas#selection to false.
2011-09-26 14:43:00 -04:00
kangax
5627b5b06c
Fix reference error.
2011-09-26 14:40:27 -04:00
kangax
19f7736658
Update documentation and fix JSDoc templates.
2011-09-22 12:40:31 -04:00
kangax
5fa051ccb9
Do not add/remove touch listeners in non-supporting environments.
2011-09-22 11:56:19 -04:00
kangax
efd2aba325
Add basic touch event support.
2011-09-21 19:29:00 -04:00
kangax
36fe5e3a6f
Fix bug w. fabric.Text not accounting for fontSize.
2011-09-21 11:18:58 -04:00
kangax
99e64c30ee
Closes #52 . Fix initialization of fabric.Group with undefined "paths".
2011-09-20 14:25:25 -04:00
kangax
db456d2b68
Closes #49 . Fix z-index issues with JSON loading.
...
`fabric.Canvas#insertAt` now accepts third (boolean) argument, indicating whether splicing can be used of insertion or not.
2011-09-19 20:23:00 -04:00
kangax
475578276e
Fix fabric.Line to update width/height when changing x1,y1,x2,y2 coordinates.
2011-09-19 17:48:16 -04:00
kangax
5dc7220425
Closes #51 again. Fix background scaling in toDataURLWithMultiplier.
2011-09-07 16:30:25 -04:00
kangax
952a31262e
Closes #51 . Fix canvas background becoming smaller when "rasterizing" canvas via toDataURLWithMultiplier.
2011-09-06 14:03:28 -04:00
kangax
8ea5f0d52c
Closes #47 . More conforming Function.prototype.bind.
2011-08-29 12:09:32 -04:00
kangax
709348f96f
More compliant Array.prototype.indexOf.
2011-08-28 21:28:46 -04:00
kangax
a3d693302c
Closes #38 . Add support for fabric.Canvas#backgroundImage.
2011-08-28 14:55:33 -04:00
kangax
09fd6210b1
"mousemove" event listener on document is now only attached after "mousedown" on canvas. This avoids unnecessary work when moving mouse outside of canvas (especially with multiple canvas instances on a page).
2011-08-26 12:58:01 -04:00
kangax
2deedd02dd
Fix regression in rendering with some of the path groups.
2011-08-26 12:54:49 -04:00
kangax
48da79220f
Fix fabric parser to workaround o3-xml bug with gEBTN("*")
2011-08-16 19:05:17 -04:00
kangax
b53d794af6
[BACK_INCOMPAT] Custom fabric build is now created with node.js and is much more flexible. Sprockets is no longer required to build fabric. Parser and node are now optional modules, which means that parseSVGDocument is no longer included in default fabric build.
2011-08-14 17:35:36 -04:00
kangax
a41fd5dffd
Closes #43 . fabric.Text#set can now accept object with property/values.
2011-08-12 13:46:17 -04:00
kangax
8f819bb760
Fabric can now run under node.js
2011-08-11 15:18:18 -04:00
kangax
35ad4bf6e3
Preparing fabric to run on node.js
2011-08-05 19:00:26 -04:00
kangax
a5b22895e7
canvas.fx --> canvas.animation
2011-08-04 21:00:44 -04:00
kangax
27999a327c
Add unit tests for fabric.loadSVGFromString.
2011-08-04 20:48:25 -04:00
kangax
044866cf44
Document fabric.loadSVGFromString. Replace canvas.loadSVGFromURL with fabric.loadSVGFromURL.
2011-08-04 11:05:40 -04:00
kangax
ace016c694
[BACK_INCOMPAT] fabric.Canvas#loadSVGFromURL --> fabric.loadSVGFromURL. Add fabric.loadSVGFromString.
2011-08-04 10:59:32 -04:00
kangax
04bb0aad66
Add "hasControls" and "hasBorders" options to fabric.Object. "hasControls", when set to false allows to fully disable controls rendering (and mouse detection); hasBorders does the same for object borders. Fix failing unit tests. Update QUnit.
2011-08-02 19:35:02 -04:00
kangax
b9dcfcf2c8
Fix bug when text objects were rendered with blue background when part of the selection.
2011-08-02 18:15:20 -04:00
kangax
9690f0849e
Fix bug with fabric.Text which would make text objects render with "drag handles" when part of the selection.
2011-08-02 17:50:13 -04:00
kangax
b33b722a3b
Fix missing references in canvas.serialization module.
2011-07-27 18:09:43 -04:00
kangax
73004e388f
Fix loadImageFromURL not invoking callback for cached images in Chrome.
2011-07-26 15:40:29 -04:00
kangax
6e8d9da003
Pass original event to "mouse:down" and "mouse:up" ones. Pass target to "mouse:move". This normalizes what's passed to events — target and event.
2011-07-26 14:06:04 -04:00
kangax
29ae6b8f0f
Closes #40 . Objects, boundaries of which are fully contained within boundaries of other objects are now sent to back/forward properly (via canvas.sendBackwards/canvas.bringForward).
2011-07-26 00:20:57 -04:00
kangax
aa885ee458
Change default font family of fabric.Text objects to "Times New Roman".
2011-07-26 00:19:47 -04:00
kangax
76b67aa34c
[BACK_INCOMPAT] More consistent option names in fabric.Text: fontfamily --> fontFamily, fontsize --> fontSize, fontweight --> fontWeight (similarly to other options, like textShadow, textDecoration, fontStyle, etc.)
2011-07-21 20:32:02 -04:00
kangax
7c03c115ac
Fix bug with extend not being defined.
2011-07-21 16:49:43 -04:00
kangax
e3dd685f1b
Add support for "textAlign" in fabric.Text. Could be any of "left", "center", or "right" values. Works with multiline text.
2011-07-21 14:53:48 -04:00
kangax
3bd5d8c1a3
Add grayscale example to customization demo. Add "mouse:move" event to fabric.Canvas and a corresponding demo.
2011-07-18 14:36:17 -04:00
kangax
b99a456989
Build files are now organized in such way that it's possible to build fabric w/o support for text and/or serialization.
2011-07-15 18:16:14 -04:00
kangax
89c030ebdf
Closes #18 . Less confusing method names: removeActiveObject --> discardActiveObject, removeActiveGroup --> discardActiveGroup (since both of those methods don't actually _remove_ objects). [BACK_INCOMPAT]
2011-07-15 11:39:48 -04:00
kangax
c046bbd5f1
Closes #34 — Support multiple sequences of command arguments in SVG paths.
2011-07-09 15:50:44 -04:00
kangax
15aef846e3
Move fx-related methods from canvas.class.js to a separate canvas.fx.js "module".
2011-07-09 12:18:51 -04:00
kangax
48a02e5ecb
Path objects that are part of the group now have 'group' property that references their parent group. Path that are part of the group are now positioned in better accordance with spec.
2011-07-09 11:10:40 -04:00
kangax
85a256a8e7
Make events more consistent.
...
"object:moved" --> "object:moving" (since it's a continuously fired event).
"object:scaled" is gone (since this case can be solved with "object:modified").
"group:modified" is gone (since this case can be solved with "object:modified").
"group:selected" --> "selection:created".
"before:group:destroyed" --> "before:selection:cleared" (only fires when there is active object or group).
"after:group:destroyed" --> "selection:cleared" (only fires when there is active object or group).
2011-07-06 15:12:44 -04:00
kangax
2b3a166d2f
fabric.util.animate is now defined in util/misc.js rather than util/dom_misc.js as it has nothing to do with DOM.
2011-07-06 14:38:56 -04:00
kangax
e3c311dfb5
Add support for elliptical arc commands (a, A) in SVG paths. Thanks @devongovett for initial code (and algorithm). Add 4 different arc test files (can be loaded in kitchensink demo).
2011-07-05 01:28:03 -04:00
kangax
5fc29b1dbb
Add fabric.Object#animate. Tests to come.
2011-07-04 23:28:32 -04:00
kangax
0e3831ed6f
Expose cursor style for hovered objects through fabric.Canvas#HOVER_CURSOR for customization purposes.
2011-07-02 01:33:43 -04:00
kangax
1bed43e3c4
Add unit tests for fabric.Observable. fabric.Canvas#observe can now accept object — canvas.observe({ event1: ..., event2: ... }).
2011-07-02 01:19:32 -04:00
kangax
dcb6ac67a5
"mouse:down" and "mouse:up" events are now being passed clicked target (when one exists). Add example with opacity and no boundaries (transparent boundaries) on an object.
2011-06-30 14:46:30 -04:00
kangax
a64f622e61
Bump version to 0.3. Experiment with using native canvas fillText for fabric.Text. Turns out multiline text is not supported natively. Will experiment more.
2011-06-30 14:37:39 -04:00
kangax
a7155ccbfb
Reorganize project structure. Add "customization" demo (work in progress).
2011-06-29 11:10:08 -04:00
kangax
628efcdc70
fabric.Element is renamed to fabric.Canvas, which makes more sense. fabric.Element is kept for compatibility reasons (but is deprecated). Bump version to 0.3.
2011-06-28 19:14:40 -04:00
kangax
fbe3246e68
Merge remote-tracking branch 'cleercode/gh-pages' into gh-pages
2011-06-28 00:35:42 -04:00
kangax
6845db3670
Rework observable mechanism: All events are now scoped to canvas instances. fabric.util.observeEvent(...) becomes canvas.observe(...) and only observes events of that particular canvas instance. fabric.util.observeEvent becomes fabric.util.observe, fabric.util.stopObservingEvent — fabric.util.stopObserving, and fabric.util.fireEvent — fabric.util.fire. These could still serve as a generic pub-sub mechanism. Add "mouse:down" event (to be consistent with "mouse:up"). Add "Event inspector" demo page.
2011-06-27 18:25:45 -04:00
kangax
e7aafae9e7
Add support for "opacity" attribute.
2011-06-14 17:28:54 -04:00
kangax
27c72bd634
Use set with object in tests (rather than chaining it).
2011-06-14 10:11:25 -04:00
Chris Lee
bef5e8310a
Activate mousedown only on left clicks
2011-06-03 11:15:56 -07:00
Chris Lee
0bf40b8bef
Fix for line width
2011-05-31 11:23:30 -07:00
Chris Lee
dce11e13ae
Global selection enable/disable through canvas.selection option
2011-05-31 10:56:09 -07:00
kangax
0a9d835b12
Dynamically generate accessors based on state properties — width, height, fill, opacity, scaleX, scaleY, etc. For example, rect.set('fill', 'red') can now be replaced with rect.setFill('red'), and rect.get('opacity') with rect.getOpacity().
2011-05-31 00:56:01 -04:00
kangax
d7fd8f0af3
fabric.Object#set can now be passed an object of property/value pairs rather than just property and value. E.g.: rect.set({ width: 100, height: 50, fill: 'red' }).
2011-05-29 21:59:48 -04:00
kangax
b15b319ed5
Add context.save + context.restore around canvas clipping to work around WebKit's performance loss ( https://bugs.webkit.org/show_bug.cgi?id=61560 ) as suggested by @ohunt
2011-05-27 13:58:39 -04:00
kangax
1d9247ab3a
When cloning canvas (in toDataURL, for example) make sure to clone clipTo (clipping function) property as well.
2011-05-26 09:03:11 -04:00
kangax
c1150c714a
fabric.Element now has forEachObject. Add header to /demos, /tests and /docs pages.
2011-05-22 09:57:37 -04:00
kangax
abaa87fbd0
Add fabric.Text#backgroundColor (can be used for text highlighting). Change default lineheight of text objects from 1 to 1.6.
2011-05-13 14:34:24 -04:00
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
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
33e929053e
More documentation.
2010-10-15 12:55:53 -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
b35b559c6a
String.prototype.trim now strips '\xA0' characters in engines which fail to match that character via \s. Fix a couple of unit tests.
2010-09-14 18:57:55 -04:00
kangax
769c0c1eb7
Function.prototype.bind now calls object it's being invoked on indirectly (better spec compliance), thanks Garrett Smith;
...
Unit test `fabric.util.makeElementUnselectable` and make test names in util module more descriptive.
2010-09-14 12:53:29 -04:00
kangax
d8937fca9f
Only render circles and ellipses according to left/top when they are part of a group.
2010-09-09 17:55:43 -04:00
kangax
e9fd7c6166
Fix bug in Polyline and Polygon points attribute parsing (thanks to unit tests).
2010-09-09 17:10:21 -04:00
kangax
8ed28fa260
Typo in Function.prototype.bind. Fix incorrect positioning when drawing circles and ellipses.
2010-09-08 23:07:52 -04:00
kangax
13db51994e
Normalize points (according to containing box) when creating Polygon and Polyline objects from elements.
2010-09-08 16:39:51 -04:00
kangax
652712601e
Canvas.Polygon.prototype._toOrigin is not used and is not needed, so remove it;
...
`parsePointsAttribute` can now parse values like "a b c d", not only "a,b c,d".
2010-09-08 16:35:06 -04:00
kangax
d00a37d593
More effecient Function.prototype.bind and unit tests for bind, getById, and toArray.
2010-09-06 12:33:57 -04:00
kangax
371d38c0de
Fix typo.
2010-09-01 17:58:42 -04:00
kangax
6ba986da49
Add unit tests for fabric.util.object.extend and fabric.util.object.clone.
2010-09-01 17:56:59 -04:00
kangax
eba95c6ee7
Loading data from json (via loadFromJSON rather than loadFromDatalessJSON) should preserve z-index order of objects
...
(but ideally, we need to get rid of duplication in `loadFromJSON` and `loadFromDatalessJSON`).
2010-08-30 19:11:14 -04:00
kangax
13d87dd060
Extend canvas element through excanvas' initElement in fabric.Element.supports.
2010-08-27 13:19:36 -04:00
kangax
2d7d61d82a
Do not set background color value to "transparent", as that results in IE8 painting black. Use "rgba(0,0,0,0)" instead.
2010-08-27 12:29:06 -04:00
kangax
7d2c7a35f2
Various IE fixes (most of the demo pages now function).
2010-08-27 12:27:49 -04:00
kangax
b04d187a04
Make free drawing path round and make sure something it's drawn immediately, on mousedown, not just on mousemove.
2010-08-10 23:26:41 -04:00
kangax
5f18c43e91
More free-drawing tweaks. Paths can now be created with different stroke width and color. Add these options to demo.
2010-08-10 19:25:14 -04:00
kangax
9d018caf40
First draft of support for free drawing.
2010-08-10 18:29:33 -04:00
kangax
81cf81b34d
Add support for locking of movement (horizontal or vertical), rotation and scaling of objects.
2010-08-04 23:23:16 -04:00
kangax
36a50ab3e8
Rendering fixes.
2010-08-02 14:50:07 -04:00
kangax
ef73b46f7c
Fix simple shapes (triangle, circle, etc.) being drawn with corners while in selection. Minor perf. improvements.
2010-08-02 14:13:07 -04:00
kangax
37abb1b8d8
Load demo images locally (to prevent SOP errors when serializing an image).
2010-08-02 11:00:38 -04:00
kangax
7e7a7ff719
Math.floor --> ~~ for slight perf. increase (only do this for positive numbers).
2010-07-31 14:06:10 -04:00
kangax
9a9605fecd
Alias Math.* methods for slight perf. increase.
...
Remove `fastestClearingMethod` test, as webkit has rendering bugs with `canvas.width = canvas.width` type of clearing.
Rename some properties/methods in `fabric.Element` from `_oXxxxx` & `_aXxxxx` to `_xxxxx`.
Add test for `fabric.Element::onFpsUpdate`.
2010-07-31 13:55:10 -04:00
kangax
89e61ed6d0
Add onFpsUpdate callback to fabric.Element. Display FPS in demo.
2010-07-30 19:39:12 -04:00
kangax
3adc592778
Make loadFromDatalessJSON set design background. Make sure its callback is invoked even if there are no objects in json.
2010-07-30 09:50:23 -04:00
kangax
a2bb25043c
toJSON now returns object instead of a string (fixes bug with JSON.stringify returning incorrect — double — serialization of an object).
2010-07-29 13:50:09 -04:00
kangax
2c8540f3b4
Forgot to pass callbacks to fxCenterObjectH and fxCenterObjectV.
2010-07-28 16:35:01 -04:00
kangax
536d532d41
Various compatibility fixes. Add fabric.util.falseFunction.
2010-07-27 17:58:23 -04:00
kangax
313cffa57f
Remove try/catch from around event handlers (for perf. reasons). Remove APE.anim references from fxCenterObjectH and fxCenterObjectV.
2010-07-27 14:07:59 -04:00
kangax
0583d7718d
Some more aliasing. Build + minify.
2010-07-26 19:24:16 -04:00
kangax
ad679a6f87
Create local aliases of some of the "long" methods.
2010-07-26 19:20:19 -04:00
kangax
04ec1688e9
Remove some unused "stub" code.
2010-07-26 18:49:51 -04:00
kangax
a535b004e6
Fix few Prototype dependencies.
2010-07-26 18:00:02 -04:00
kangax
e5fa742aff
Alias some methods in fabric.Element for perf. reasons. Few improvements to demo.
2010-07-26 14:58:49 -04:00
kangax
9f77d3a0a5
Add google closure compiler and explain how to minify fabric.js with it. Fix few omissions in jsdoc comments.
2010-07-26 00:48:26 -04:00
Juriy Zaytsev
5f04e2d495
Add fabric.Triangle class (untested for now). Start beefing up demo.
2010-07-24 01:03:28 -04:00
Juriy Zaytsev
a0221539e7
Make sure line color can be set via "fill" property.
2010-07-23 23:42:06 -04:00
Juriy Zaytsev
492eda82a6
Fix loading order of objects in loadFromDatalessJSON. Fix few unit tests.
2010-07-13 16:17:33 -04:00
Juriy Zaytsev
2340a98526
Rename canvas_*.class.js files to just *.class.js
2010-07-09 21:50:13 -04:00
Juriy Zaytsev
2004756f65
Add copyright comment. Update minified version.
2010-07-09 21:25:28 -04:00
Juriy Zaytsev
2e72a4d8c5
Rename Canvas.* to fabric.* (lowercased name makes more sense since Canvas is not a constructor).
2010-07-09 19:43:50 -04:00
Juriy Zaytsev
4b5ac284e8
Fix remaining failing tests.
2010-07-09 18:58:33 -04:00
Juriy Zaytsev
f96efe8e3d
Replace APE animation with Canvas.base.animate in Canvas.Element::fxStraighten.
2010-07-09 14:26:49 -04:00
Juriy Zaytsev
90d8545644
Add Canvas.base.animate (still needs tests!).
2010-07-09 14:22:35 -04:00
Juriy Zaytsev
7242ea93de
Change Prototype unit testing framework to QUnit; change all tests accordingly.
2010-07-09 10:21:40 -04:00
Juriy Zaytsev
be20251d85
Remove few more prototype-isms, start transitioning to QUnit (it's not ideal, but should do for now).
2010-06-26 22:57:02 -04:00
Juriy Zaytsev
8ee515e647
Add Canvas.base.request and finally make demo page work. Remove remnants of Prototype.js from fabric.js.
2010-06-24 03:37:02 -04:00
Juriy Zaytsev
9e1bf5b322
Replace Event.stopObserving with Canvas.base.removeEventListener.
2010-06-24 02:16:52 -04:00
Juriy Zaytsev
61fbfae2d8
Start experimenting with scout.js (on-demand code fetching based on feature test). Remove some redundant code from Canvas.Element. Add demo folder to /test.
2010-06-17 13:15:51 -04:00
Juriy Zaytsev
05a6aa4d42
Prototype.js and APE.js are no longer dependencies (shrinking overall size of fabric.js by ~150KB). Add json2.js and a simple base library (still needs tests).
2010-06-17 10:00:47 -04:00
Juriy Zaytsev
fa4224649c
Building dist file is now done via sprockets.
2010-06-11 19:37:06 -04:00
Juriy Zaytsev
fcb2877557
Replace $w with split(' ') (to remove dependency on global, non-descriptive variable and Prototype in general). Add few missing console.warn statements when double initialization is attempted.
2010-06-11 10:29:12 -04:00
Juriy Zaytsev
0394fb94ad
Small tweaks: normalize whitespace and brackets, make initialization of "classes" consistent.
2010-06-10 13:57:59 -04:00
Juriy Zaytsev
ca0df1bd15
"Collapse" few var statements.
2010-06-10 11:49:13 -04:00
Juriy Zaytsev
36416e65a3
Split 2D.js into canvas_point.class.js and canvas_intersection.class.js
2010-06-10 11:37:51 -04:00
Juriy Zaytsev
ea4e1e3a9c
Add W3C SVG 1.2 Tiny test suite
2010-06-10 11:14:53 -04:00
Juriy Zaytsev
1893b691c5
Delete bezier.js
2010-06-09 23:58:41 -04:00
Juriy Zaytsev
3df6dadf08
Fix inconsistent whitespace in 2D.js
2010-06-09 23:32:12 -04:00
Juriy Zaytsev
770e47b115
Add a couple more dependencies to /lib. Remove unneeded code from 2D.js and unminify it.
2010-06-09 23:30:25 -04:00
Juriy Zaytsev
c519c147aa
Initial import of source files.
2010-06-09 18:34:55 -04:00