fabric-rails 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/fabric/rails/version.rb +2 -2
- data/vendor/assets/javascripts/fabric.js +50 -78
- metadata +6 -6
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/fabric/rails/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/* build: `node build.js modules=ALL` */
|
2
2
|
/*! Fabric.js Copyright 2008-2012, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
3
3
|
|
4
|
-
var fabric = fabric || { version: "0.9.
|
4
|
+
var fabric = fabric || { version: "0.9.1" };
|
5
5
|
|
6
6
|
if (typeof exports != 'undefined') {
|
7
7
|
exports.fabric = fabric;
|
@@ -2932,28 +2932,28 @@ fabric.util.string = {
|
|
2932
2932
|
* @param {Function} callback Callback to execute when script is finished loading
|
2933
2933
|
*/
|
2934
2934
|
function getScript(url, callback) {
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
2939
|
-
|
2940
|
-
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
2945
|
-
|
2946
|
-
|
2947
|
-
|
2948
|
-
|
2949
|
-
|
2950
|
-
|
2951
|
-
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2935
|
+
var headEl = fabric.document.getElementsByTagName("head")[0],
|
2936
|
+
scriptEl = fabric.document.createElement('script'),
|
2937
|
+
loading = true;
|
2938
|
+
|
2939
|
+
scriptEl.type = 'text/javascript';
|
2940
|
+
scriptEl.setAttribute('runat', 'server');
|
2941
|
+
|
2942
|
+
/** @ignore */
|
2943
|
+
scriptEl.onload = /** @ignore */ scriptEl.onreadystatechange = function(e) {
|
2944
|
+
if (loading) {
|
2945
|
+
if (typeof this.readyState == 'string' &&
|
2946
|
+
this.readyState !== 'loaded' &&
|
2947
|
+
this.readyState !== 'complete') return;
|
2948
|
+
loading = false;
|
2949
|
+
callback(e || fabric.window.event);
|
2950
|
+
scriptEl = scriptEl.onload = scriptEl.onreadystatechange = null;
|
2951
|
+
}
|
2952
|
+
};
|
2953
|
+
scriptEl.src = url;
|
2954
|
+
headEl.appendChild(scriptEl);
|
2955
|
+
// causes issue in Opera
|
2956
|
+
// headEl.removeChild(scriptEl);
|
2957
2957
|
}
|
2958
2958
|
|
2959
2959
|
fabric.util.getScript = getScript;
|
@@ -10542,14 +10542,14 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|
10542
10542
|
break;
|
10543
10543
|
|
10544
10544
|
case 't': // shorthand quadraticCurveTo, relative
|
10545
|
-
|
10545
|
+
|
10546
10546
|
// transform to absolute x,y
|
10547
10547
|
tempX = x + current[1];
|
10548
10548
|
tempY = y + current[2];
|
10549
|
-
|
10549
|
+
|
10550
10550
|
|
10551
10551
|
if (previous[0].match(/[QqTt]/) === null) {
|
10552
|
-
// If there is no previous command or if the previous command was not a Q, q, T or t,
|
10552
|
+
// If there is no previous command or if the previous command was not a Q, q, T or t,
|
10553
10553
|
// assume the control point is coincident with the current point
|
10554
10554
|
controlX = x;
|
10555
10555
|
controlY = y;
|
@@ -10657,7 +10657,9 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|
10657
10657
|
ctx.fillStyle = this.overlayFill;
|
10658
10658
|
}
|
10659
10659
|
else if (this.fill) {
|
10660
|
-
ctx.fillStyle = this.fill
|
10660
|
+
ctx.fillStyle = this.fill.toLiveGradient
|
10661
|
+
? this.fill.toLiveGradient(ctx)
|
10662
|
+
: this.fill;
|
10661
10663
|
}
|
10662
10664
|
|
10663
10665
|
if (this.stroke) {
|
@@ -10955,60 +10957,28 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|
10955
10957
|
}
|
10956
10958
|
},
|
10957
10959
|
|
10958
|
-
/**
|
10959
|
-
* @private
|
10960
|
-
* @method _initProperties
|
10961
|
-
*/
|
10962
|
-
// _initProperties: function() {
|
10963
|
-
// this.stateProperties.forEach(function(prop) {
|
10964
|
-
// if (prop === 'fill') {
|
10965
|
-
// this.set(prop, this.options[prop]);
|
10966
|
-
// }
|
10967
|
-
// else if (prop === 'angle') {
|
10968
|
-
// this.setAngle(this.options[prop]);
|
10969
|
-
// }
|
10970
|
-
// else {
|
10971
|
-
// this[prop] = this.options[prop];
|
10972
|
-
// }
|
10973
|
-
// }, this);
|
10974
|
-
// },
|
10975
|
-
|
10976
10960
|
/**
|
10977
10961
|
* Renders this group on a specified context
|
10978
10962
|
* @method render
|
10979
10963
|
* @param {CanvasRenderingContext2D} ctx Context to render this instance on
|
10980
10964
|
*/
|
10981
10965
|
render: function(ctx) {
|
10982
|
-
|
10983
|
-
// fast-path, rendering image stub
|
10984
|
-
ctx.save();
|
10966
|
+
ctx.save();
|
10985
10967
|
|
10986
|
-
|
10987
|
-
|
10988
|
-
|
10989
|
-
this.drawBorders(ctx);
|
10990
|
-
this.drawCorners(ctx);
|
10991
|
-
}
|
10992
|
-
ctx.restore();
|
10968
|
+
var m = this.transformMatrix;
|
10969
|
+
if (m) {
|
10970
|
+
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
10993
10971
|
}
|
10994
|
-
else {
|
10995
|
-
ctx.save();
|
10996
|
-
|
10997
|
-
var m = this.transformMatrix;
|
10998
|
-
if (m) {
|
10999
|
-
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
11000
|
-
}
|
11001
10972
|
|
11002
|
-
|
11003
|
-
|
11004
|
-
|
11005
|
-
|
11006
|
-
|
11007
|
-
|
11008
|
-
|
11009
|
-
}
|
11010
|
-
ctx.restore();
|
10973
|
+
this.transform(ctx);
|
10974
|
+
for (var i = 0, l = this.paths.length; i < l; ++i) {
|
10975
|
+
this.paths[i].render(ctx, true);
|
10976
|
+
}
|
10977
|
+
if (this.active) {
|
10978
|
+
this.drawBorders(ctx);
|
10979
|
+
this.hideCorners || this.drawCorners(ctx);
|
11011
10980
|
}
|
10981
|
+
ctx.restore();
|
11012
10982
|
},
|
11013
10983
|
|
11014
10984
|
/**
|
@@ -12668,16 +12638,16 @@ fabric.Image.filters.Tint = fabric.util.createClass( /** @scope fabric.Image.fil
|
|
12668
12638
|
iLen = data.length, i,
|
12669
12639
|
r, g, b, a;
|
12670
12640
|
|
12671
|
-
|
12672
|
-
|
12673
|
-
|
12674
|
-
|
12675
|
-
|
12641
|
+
var rgb = parseInt(this.color).toString(16);
|
12642
|
+
var cr = parseInt('0x'+rgb.substr(0, 2));
|
12643
|
+
var cg = parseInt('0x'+rgb.substr(2, 2));
|
12644
|
+
var cb = parseInt('0x'+rgb.substr(4, 2));
|
12645
|
+
|
12676
12646
|
for (i = 0; i < iLen; i+=4) {
|
12677
12647
|
|
12678
12648
|
a = data[i+3];
|
12679
12649
|
|
12680
|
-
if (a > 0){
|
12650
|
+
if (a > 0){
|
12681
12651
|
data[i] = cr;
|
12682
12652
|
data[i+1] = cg;
|
12683
12653
|
data[i+2] = cb;
|
@@ -12939,6 +12909,8 @@ fabric.Image.filters.Tint.fromObject = function(object) {
|
|
12939
12909
|
this._shadowOffsets = o.shadowOffsets;
|
12940
12910
|
this._shadows = o.shadows || [ ];
|
12941
12911
|
|
12912
|
+
el = null;
|
12913
|
+
|
12942
12914
|
// need to set coords _after_ the width/height was retreived from Cufon
|
12943
12915
|
this.setCoords();
|
12944
12916
|
},
|
@@ -13632,4 +13604,4 @@ fabric.Image.filters.Tint.fromObject = function(object) {
|
|
13632
13604
|
fabric.Canvas.prototype.setHeight = fabric.StaticCanvas.prototype.setHeight;
|
13633
13605
|
}
|
13634
13606
|
|
13635
|
-
})();
|
13607
|
+
})();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabric-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &70324941035400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '5.0'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70324941035400
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: thor
|
30
|
-
requirement: &
|
30
|
+
requirement: &70324941068700 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '0.14'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70324941068700
|
39
39
|
description: This gem provides fabric.js for your Rails 3 application via the asset
|
40
40
|
pipeline.
|
41
41
|
email:
|