Commit graph

159 commits

Author SHA1 Message Date
Kienz
66fc8f4d4b Parse SVG stroke-opacity and fill-opacity
- SVG attribute opacity is now used for object's opacity
- fill-opacity and stroke-opacity are added to stroke and fill color value
- Add hsl/hsla support (e.g. hsl(270, 80%, 10%), hsla(320, 10%, 66%, 0.5))
- Add support for rgb/rgba values with whitespaces around values (e.g. rgba( 255 , 100 , 50 , 0.1 )) and percentage values (e.g. rgb(100%, 67%, 15%, 0.8))
- Delete stroke and strokeWidth from fabric.Text (defined in fabric.Object)
- New unit test for parse stroke-opacity and fill-opacity
- Update unit tests (new tests for hsl/hsla and rgb/rgba (whitespaces and percentage values))
- Change equal and deepEqual parameter order (e.g. equal(actualValue, expectedValue, message))
- Doc additions
2013-05-25 11:03:09 +02:00
Kienz
d80fec5df1 Better strokeDashArray support + Fixes
- fabric.Text has now strokeDashArray support (only native support)
- fabric.Text.fill = null should now work
- Fix save/restore context in render methods => setLineDash affected drawBorder/drawControls
- Add strokeLineCap (default "butt"), strokeLineJoin (default "miter") and strokeMiterLimit (default 10)
- Add support for fabric.Object#fromElement for strokeDashArray (and other stroke properties)
- Add @default tag to properties (JSDoc 3)
- strokeDashArray now only works if stroke property is defined
- Add trokeLineCap (default "round"), strokeLineJoin (default "round") to fabric.BaseBrush
- Updated unit tests
2013-05-18 13:01:34 +02:00
kangax
5f8ca2cbc9 Make background white when generating data url jpeg image. Closes #613 2013-05-07 11:37:00 -04:00
kangax
a47128afa4 Add support for same options in fabric.Object#toDataURL as there are in fabric.Canvas#toDataURL. Closes #609 2013-05-06 11:52:16 -04:00
kangax
d6e292e482 Fix text rendering. Closes #590. Version 1.1.12 2013-05-05 13:23:49 -04:00
kangax
fde521317e Store result of setLineDash support check. Build distribution. Version 1.1.11 2013-05-04 20:29:59 -04:00
Kienz
8645378288 Implement dashed stroke + some fixes with stroke, fill, removeShadow and clipTo + fixes in brushes
- fabric.Rect (now uses fabric.util.drawDashedLine), fabric.Line, fabric.Triangle, fabric.Polygon, fabric.Polyline, fabric.Image now supports dashed stroke
- fabric.Circle and fabric.Ellipse actual only supports native dashed stroke (browser must support context.setLineDash)
- fabric.Image.toSVG() has stroke/dashed-stroke support
- fabric.Object#clipTo has now affect on fabric.Image's stroke
- fabric.Shadow#affectStroke is considered - _removeShadow is now called in _renderFill (check whether stroke is to be affected) and _renderStroke
- reset shadow styles (contextTop) in fabric.PencilBrush, fabric.CircleBrush and fabric.Spraybrush (fabric.BaseBrush.removeShadowStyles)
2013-05-04 18:25:57 +02:00
kangax
35d5cf220f [BACK_INCOMPAT] Make fabric.Object#toDataURL synchronous. Fix fabric.Object#cloneAsImage to preserve angle. Closes #596 2013-05-01 14:49:42 -04:00
kangax
775df6e836 Move state-related methods to stateful mixin 2013-05-01 09:29:57 -04:00
Stefan Kienzle
6caf60670b Fixed _renderFill - fallback for offsetX/offsetY
If object.fill.offsetX or object.fill.offsetY is undefined (e.g. fill = fabric.Gradient) browser might have problems (seen in firefox 3.6.28).
2013-04-30 16:27:01 +03:00
kangax
a6a5cb4a54 Load image via fabric.util.loadImage in cloneAsImage. Add fabric.util.createImage helper. Closes #593 2013-04-29 15:16:59 -04:00
kangax
4e1a26cc11 Update docs 2013-04-25 14:21:32 -04:00
kangax
c16dcf88a4 Change inline docs to conform to jsdoc3 2013-04-24 12:58:04 -04:00
kangax
22de40dc54 Add support for pattern offsets (via fabric.Pattern#offsetX/offsetY). Version 1.1.8 2013-04-22 09:16:58 -04:00
Stefan Kienzle
571887036f Bugfix object.opacity == 0 in svg output
If object.opacity = 0 the svg output sets opacity to 1.
2013-04-19 14:35:52 +03:00
kangax
8879c73af7 Document lock* properties. Build distribution 2013-04-16 12:44:54 -04:00
kangax
a0bc7b6904 Fix doc typo 2013-04-06 12:46:01 +02:00
kangax
fcc0c5cbbb Only call change and complete callbacks once, when animating multiple properties. Closes #544 2013-04-06 12:44:10 +02:00
kangax
d24d6307e5 [BACK_INCOMPAT] fabric.Object.setActive(…) -> fabric.Object.set('active', …). fabric.Object.isActive is gone (use active instead) 2013-03-29 16:26:27 +01:00
kangax
27c6f2529c Mention that set doesn't update border/control and that setCoords should be called for that. Closes #518. 2013-03-29 12:44:05 +01:00
Juriy Zaytsev
81993d21fb Merge pull request #494 from Kienz/moveTo
Implement fabric.StaticCanvas#moveTo(object, index)
2013-03-23 14:55:14 -07:00
Kienz
3a0a2c7fd2 Implement fabric.StaticCanvas#moveTo to move object to specified level in stack of drawn objects
You can also move fabric.Group objects in the grub objects stack to a specified level.

Add unit tests for moveTo.
2013-03-22 15:10:44 +01:00
Kienz
4b1939e5d3 Add check if object is visible to fabric.Image and fabric.Path. Now all fabric instances with own render method should check for visible property.
Some doc updates - add noTransform to doc and set it optional
2013-03-22 12:10:34 +01:00
kangax
7f19110967 Update docs on left/top being relative to object center 2013-03-19 13:20:21 +01:00
kangax
2622a380bf [BACK_INCOMPAT] fabric.Group#objects -> fabric.Group._objects (making it consistent with canvas._objects). Objects in group always have group reference to a group they're in. bringToFront, sendToBack, etc. now work in relation to group when called on objects within group. 2013-03-16 16:41:19 +01:00
kangax
85fd7ee852 Add support for clipping objects. Closes #64 2013-03-10 21:06:17 +01:00
Juriy Zaytsev
c366e1d184 Merge pull request #470 from Kienz/visiblePropFix
Bugfix fabric.PathGroup if object is not visible
2013-03-09 15:04:58 -08:00
Kienz
df46e3af26 Bugfix fabric.PathGroup if object is not visible
- if object is not visible and of type 'path-group' the object was still drawn
2013-03-09 22:15:31 +01:00
Kienz
e35e1a0191 [BACK_INCOMPAT] Implement fabric.Gradient#toSVG() and radialGradient
- Implement radial gradient and expand linear gradient (stop-opacity should now take into account)
- Gradients should now be included in the SVG output for the following fabric objects: circle, ellipse, line, path, polygon, polyline, rect and triangle (text is not yet implemented)
- Gradients (linear / radial) can be applied to stroke or fill property => change setGradientFill(options) to setGradient(type, options)
- Change toObject() that linear and radial gradients can be serialized
- Expand fabric.Color by 16 basic colors fabric.Color.colorNameMap => gradients with e.g. stop-color="blue" and stop-opacity="0.5 can be converted to RGBA color
- RGBA colors in svg has no affect (convert to RGB color), only stop-opacity has affect to color opacity
- Attached some test svg files http://kienzle.geschaeft.s3.amazonaws.com/projects/fabricjs/gradients/gradients.rarUpdate setGradient and addColorStop interface

Update setGradient and addColorStop interface
- setGradient('fill', {x1: 50, y2: 10, colorStops: {'0.7', 'rgba(0,153,153,0.5)'}});
- addColorStop({'0.4', 'blue'});
2013-03-09 21:00:54 +01:00
kangax
e917b144aa Remove unnecessary space in SVG output 2013-03-06 18:55:26 +01:00
kangax
506125bbe6 [BACK_INCOMPAT] fabric.Canvas.toDataURL now accepts options object instead linear arguments. fabric.Canvas.toDataURLWithMultiplier is deprecated; use toDataURL({ multiplier: … }) instead. 2013-03-06 18:47:50 +01:00
kangax
43dd170f5b Add fabric.Object#visible property. Closes #342. Version 1.0.13. 2013-03-06 18:45:18 +01:00
kangax
9f934d4dad Minor style change 2013-03-05 19:33:16 +01:00
kangax
638876f3f8 Add support for passing additional state properties into saveState 2013-03-02 01:25:08 +01:00
Kienz
ae67d83216 Update setGradient and addColorStop interface
- setGradient('fill', {x1: 50, y2: 10, colorStops: {'0.7', 'rgba(0,153,153,0.5)'}});
- addColorStop({'0.4', 'blue'});
2013-02-25 18:26:20 +01:00
kangax
17a88e93e1 Doc fixes 2013-02-24 12:40:16 +01:00
Kienz
4c4f845bfe [BACK_INCOMPAT] Implement fabric.Gradient#toSVG() and radialGradient
- Implement radial gradient and expand linear gradient (stop-opacity should now take into account)
- Gradients should now be included in the SVG output for the following fabric objects: circle, ellipse, line, path, polygon, polyline, rect and triangle (text is not yet implemented)
- Gradients (linear / radial) can be applied to stroke or fill property => change setGradientFill(options) to setGradient(type, options)
- Change toObject() that linear and radial gradients can be serialized
- Expand fabric.Color by 16 basic colors fabric.Color.colorNameMap => gradients with e.g. stop-color="blue" and stop-opacity="0.5 can be converted to RGBA color
- RGBA colors in svg has no affect (convert to RGB color), only stop-opacity has affect to color opacity
- Attached some test svg files http://kienzle.geschaeft.s3.amazonaws.com/projects/fabricjs/gradients/gradients.rar
2013-02-23 17:02:52 +01:00
kangax
be4db2f409 Fix doc. Thanks @rodrigopandini 2013-02-20 23:42:38 +01:00
kangax
9be89b2f2f drawCorners -> drawControls, for consistency. Remove unused hasCorners and use hasControls instead of hideCorners. Version 1.0.12 2013-02-20 13:19:22 +01:00
kangax
9df85553b9 [BACK_INCOMPAT] Add fabric.util.createAccessors. Add accessors for fabric.Text -specific properties (setTextDecoration, setFontWeight, setFontStyle, etc.). Make text object dimensions change when setting dimension-affecting properties. fabric.Text#setFontsize becomes setFontSize. Version 1.0.11. 2013-02-18 16:22:48 +01:00
kangax
e4719d4300 Add support for animating 2nd level object properties 2013-02-06 16:20:53 +01:00
kangax
5ee9b13a92 Add support for shadows (via fabric.Shadow) 2013-02-04 20:49:05 +01:00
kangax
6777c50012 Add support for patterns 2013-02-03 02:15:29 +01:00
kangax
87a1bb31bf Amalgamate canvas creation + VML initialization into one place. Add new method fabric.util.createCanvasElement. Version 1.0.3. 2013-01-25 14:23:13 +01:00
kangax
70119f7095 Refactor some logic from canvas and object classes into mixins 2013-01-20 20:40:26 +01:00
kangax
4a84bf92a7 Clone options object of animate (to avoid conflicts) 2013-01-10 14:20:52 +01:00
kangax
3194c1903a Do not show corners in groups 2013-01-10 14:20:25 +01:00
kangax
dffe675eb2 Fix toDataURL doc 2013-01-10 14:20:13 +01:00
kangax
dc2e5210ae Work around VML's clearRect bug 2013-01-03 01:18:29 +01:00
kangax
2735d543e2 Merge master. Enable hasRotatingPoint by default (now that objects are not rotated via corners) 2012-12-26 11:18:17 +01:00