Commit graph

46 commits

Author SHA1 Message Date
kangax
4c5df5ea0c Specify that loadSVGFromURL uses XHR and conforms to SOP 2013-04-02 13:47:47 +02:00
kangax
5a91472bdc Remove trailing comma 2013-02-17 13:26:45 +01:00
Kienz
5e81f7ab09 Add backgroundColor to svg output
Add backgroundColorPattern to svg output
Bugfix backgroundImage in sag output - width/height are depend on backgroundImageStretch
Bugfix in setBackgroundColor - rename pattern to repeat
2013-02-14 22:06:01 +01:00
kangax
8b04e286a8 Log full errors instead of just its messages 2013-02-04 20:49:05 +01:00
kangax
c11abb377f Fix tests. Build distribution. Version 0.9.35. 2012-12-23 15:28:08 +01:00
kangax
a7a6c38384 Fix incorrect parsing of fontSize which made text not appear when loaded from SVG. Closes #331. 2012-12-23 15:18:46 +01:00
kangax
c8172be31d Final doc additions. Every public method is now documented! 2012-12-16 20:44:26 +01:00
kangax
3416d8a090 Documentation additions. 2012-12-13 15:46:06 +01:00
kangax
f0b5329157 Doc additions, fixes. 2012-11-23 13:38:26 +01:00
kangax
84a956c4b6 Lint everything with JSHint. Version 0.9.14. 2012-10-14 02:53:12 +02:00
kangax
9a7d40d7d7 Change the way gradients are initialized.
They no longer need `ctx` property, which is now taken from object directly during rendering time.
Add unit tests for gradients.
2012-08-20 18:23:53 +02:00
joshpearce
5923e008f7 Update src/parser.js 2012-08-19 21:36:37 -03:00
Josh Pearce
cf7a6d1482 Added reviver method in parser
The optional method is used when asking fabric to
load an SVG file and parse it, instantiating fabric objects.
After each fabric object is created, reviver(ele, obj) is
called so you can parse our custom attributes, or do
anything else custom.
2012-08-19 16:07:28 -04:00
kangax
3ce8507932 Implement fabric.Text.fromElement. Closes #182. 2012-08-11 18:59:53 +02:00
kangax
b701627f42 Fix "stroke-width" being ignored in style attribute. 2012-06-10 12:13:12 +02: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
f71f634afd IE8 and lower now actually render and show any loaded SVG 2012-01-18 10:44:03 +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
d870410a7d First (and almost complete) implementation of fabric.Canvas#toSVG. 2012-01-02 16:14:20 -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
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
35ad4bf6e3 Preparing fabric to run on node.js 2011-08-05 19:00:26 -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
ef425d18c5 Fix some of the parser.js unit tests by making resolveGradients more lenient. 2011-02-11 01:44:08 -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
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
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
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
e9fd7c6166 Fix bug in Polyline and Polygon points attribute parsing (thanks to unit tests). 2010-09-09 17:10:21 -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
ad679a6f87 Create local aliases of some of the "long" methods. 2010-07-26 19:20:19 -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
2340a98526 Rename canvas_*.class.js files to just *.class.js 2010-07-09 21:50:13 -04:00
Renamed from src/canvas_parser.js (Browse further)