Compare commits

..

1 Commits

Author SHA1 Message Date
Tomas Alabes c5c0b6ea72 Should I remove the stroke adjustments and relay on non-scaling-stroke? 2015-08-31 19:43:40 -07:00
10 changed files with 57 additions and 69 deletions

View File

@ -1,10 +1,12 @@
{
"name": "raphael",
"main": "raphael.js",
"devDependencies": {
"requirejs": "~2.1.17",
"dependencies": {
"eve": "https://github.com/adobe-webplatform/eve.git#eef80ed"
},
"devDependencies": {
"requirejs": "~2.1.17"
},
"ignore": [
"**/.*",
"*.html",

View File

@ -5366,7 +5366,7 @@
| })(Raphael.ninja());
\*/
R.ninja = function () {
//oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
return R;
};
/*\

View File

@ -142,7 +142,7 @@
}
}
$(o, {
fill: "url('" + (document.location.origin || '') + document.location.pathname + "#" + id + "')",
fill: "url('" + document.location.origin + document.location.pathname + "#" + id + "')",
opacity: 1,
"fill-opacity": 1
});
@ -474,12 +474,6 @@
}
break;
case "stroke-width":
if (o._.sx != 1 || o._.sy != 1) {
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
}
if (o.paper._vbSize) {
value *= o.paper._vbSize;
}
node.setAttribute(att, value);
if (attrs["stroke-dasharray"]) {
addDashes(o, attrs["stroke-dasharray"], params);
@ -867,11 +861,6 @@
this.pattern && updatePosition(this);
this.node && $(this.node, {transform: this.matrix});
if (_.sx != 1 || _.sy != 1) {
var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1;
this.attr({"stroke-width": sw});
}
//Reduce transform string
_.transform = this.matrix.toTransformString();
@ -1338,13 +1327,6 @@
viewBox: vb,
preserveAspectRatio: aspectRatio
});
while (size && top) {
sw = "stroke-width" in top.attrs ? top.attrs["stroke-width"] : 1;
top.attr({"stroke-width": sw});
top._.dirty = 1;
top._.dirtyT = 1;
top = top.prev;
}
this._viewBox = [x, y, w, h, !!fit];
return this;
};

View File

@ -899,9 +899,9 @@
};
R._engine.setViewBox = function (x, y, w, h, fit) {
R.eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
var width = this.width,
height = this.height,
size = 1 / mmax(w / width, h / height),
var paperSize = this.getSize(),
width = paperSize.width,
height = paperSize.height,
H, W;
if (fit) {
H = height / h;
@ -917,10 +917,10 @@
this._viewBoxShift = {
dx: -x,
dy: -y,
scale: size
scale: paperSize
};
this.forEach(function (el) {
el.transform("");
el.transform("...");
});
return this;
};

View File

@ -9,22 +9,30 @@
<!-- To work with full version -->
<!--<script type="text/javascript" src="../raphael.js"></script>-->
<script type="text/javascript" src="eve.js"></script>
<script type="text/javascript" src="raphael.core.js"></script>
<script type="text/javascript" src="raphael.vml.js"></script>
<script type="text/javascript" src="raphael.svg.js"></script>
<!-- To work with minified version -->
<!--<script type="text/javascript" src="../raphael-min.js"></script>-->
<!-- Comment this script tag if you are testing with AMD -->
<!--<script type="text/javascript">
<script type="text/javascript">
// Initialize container when document is loaded
window.onload = function () {
paper = Raphael(0, 0, 640, 720, "container");
paper.circle(100, 100, 100); //example
paper.circle(50, 50, 20).attr({'stroke-width': 2}); //example
paper.circle(70, 70, 20).attr({'stroke-width': 2}).transform("s2"); //example
paper.setViewBox(0, 0, 100, 100);
//Different strokes -> http://www.w3.org/TR/SVGTiny12/painting.html#NonScalingStroke
};
//Work here, in a separate script file or via command line
</script>-->
</script>
<!-- Use amdDev.js to work with AMD and Raphael -->
<!-- You need to do a 'bower install -D' first to get requirejs -->
<script data-main="amdDev" src="../bower_components/requirejs/require.js"></script>
<!--<script data-main="amdDev" src="../bower_components/requirejs/require.js"></script>-->
</head>
<body>

View File

@ -1,6 +1,6 @@
{
"name": "raphael",
"version": "2.1.4b",
"version": "2.1.4",
"description": "JavaScript Vector Library",
"main": "raphael.amd.js",
"scripts": {
@ -32,6 +32,6 @@
"url": "https://github.com/DmitryBaranovskiy/raphael/issues"
},
"homepage": "https://github.com/DmitryBaranovskiy/raphael",
"_id": "raphael@2.1.4a",
"_id": "raphael@2.1.4",
"_from": "raphael@"
}

9
raphael-min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4b - JavaScript Vector Library │ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Core Module │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
@ -84,7 +84,7 @@
}
}
}
R.version = "2.1.4b";
R.version = "2.1.4";
R.eve = eve;
var loaded,
separator = /[, ]+/,
@ -5366,7 +5366,7 @@
| })(Raphael.ninja());
\*/
R.ninja = function () {
//oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
return R;
};
/*\
@ -5414,7 +5414,7 @@
}));
// ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4b - JavaScript Vector Library │ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
// │ SVG Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
@ -5557,7 +5557,7 @@
}
}
$(o, {
fill: "url('" + (document.location.origin || '') + document.location.pathname + "#" + id + "')",
fill: "url('" + document.location.origin + document.location.pathname + "#" + id + "')",
opacity: 1,
"fill-opacity": 1
});
@ -5892,9 +5892,6 @@
if (o._.sx != 1 || o._.sy != 1) {
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
}
if (o.paper._vbSize) {
value *= o.paper._vbSize;
}
node.setAttribute(att, value);
if (attrs["stroke-dasharray"]) {
addDashes(o, attrs["stroke-dasharray"], params);
@ -6839,7 +6836,7 @@
}));
// ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4b - JavaScript Vector Library │ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
// │ VML Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
@ -7739,9 +7736,9 @@
};
R._engine.setViewBox = function (x, y, w, h, fit) {
R.eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
var width = this.width,
height = this.height,
size = 1 / mmax(w / width, h / height),
var paperSize = this.getSize(),
width = paperSize.width,
height = paperSize.height,
H, W;
if (fit) {
H = height / h;
@ -7757,10 +7754,10 @@
this._viewBoxShift = {
dx: -x,
dy: -y,
scale: size
scale: paperSize
};
this.forEach(function (el) {
el.transform("");
el.transform("...");
});
return this;
};

View File

@ -381,7 +381,7 @@
}));
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4b - JavaScript Vector Library │ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Core Module │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
@ -466,7 +466,7 @@
}
}
}
R.version = "2.1.4b";
R.version = "2.1.4";
R.eve = eve;
var loaded,
separator = /[, ]+/,
@ -5748,7 +5748,7 @@
| })(Raphael.ninja());
\*/
R.ninja = function () {
//oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
oldRaphael.was ? (g.win.Raphael = oldRaphael.is) : delete Raphael;
return R;
};
/*\
@ -5796,7 +5796,7 @@
}));
// ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4b - JavaScript Vector Library │ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
// │ SVG Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
@ -5939,7 +5939,7 @@
}
}
$(o, {
fill: "url('" + (document.location.origin || '') + document.location.pathname + "#" + id + "')",
fill: "url('" + document.location.origin + document.location.pathname + "#" + id + "')",
opacity: 1,
"fill-opacity": 1
});
@ -6274,9 +6274,6 @@
if (o._.sx != 1 || o._.sy != 1) {
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
}
if (o.paper._vbSize) {
value *= o.paper._vbSize;
}
node.setAttribute(att, value);
if (attrs["stroke-dasharray"]) {
addDashes(o, attrs["stroke-dasharray"], params);
@ -7221,7 +7218,7 @@
}));
// ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4b - JavaScript Vector Library │ \\
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
// │ VML Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\
@ -8121,9 +8118,9 @@
};
R._engine.setViewBox = function (x, y, w, h, fit) {
R.eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
var width = this.width,
height = this.height,
size = 1 / mmax(w / width, h / height),
var paperSize = this.getSize(),
width = paperSize.width,
height = paperSize.height,
H, W;
if (fit) {
H = height / h;
@ -8139,10 +8136,10 @@
this._viewBoxShift = {
dx: -x,
dy: -y,
scale: size
scale: paperSize
};
this.forEach(function (el) {
el.transform("");
el.transform("...");
});
return this;
};