Skip to content

Commit b2280bc

Browse files
committed
rename build folder to dist
1 parent f3f92ab commit b2280bc

File tree

9 files changed

+46
-20
lines changed

9 files changed

+46
-20
lines changed

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function(grunt) {
2525
src: [
2626
'src/promise.js', 'src/fallback.js', 'src/**/*.js'
2727
],
28-
dest: 'build/<%= pkg.name %>.js'
28+
dest: 'dist/<%= pkg.name %>.js'
2929
},
3030
options:{
3131
banner: meta.banner + meta.pre,
@@ -71,7 +71,7 @@ module.exports = function(grunt) {
7171
uglify: {
7272
dist: {
7373
src: ['<%= concat.dist.dest %>'],
74-
dest: 'build/<%= pkg.name %>.min.js'
74+
dest: 'dist/<%= pkg.name %>.min.js'
7575
},
7676
options: {
7777
banner: meta.banner

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "html2canvas",
3-
"version": "0.4.1",
3+
"version": "0.5.0-alpha",
44
"description": "Screenshots with JavaScript",
5-
"main": "build/html2canvas.js",
5+
"main": "dist/html2canvas.js",
66
"ignore": [
77
"tests",
88
".travis.yml"
99
]
10-
}
10+
}

build/html2canvas.min.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

build/html2canvas.js renamed to dist/html2canvas.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
html2canvas 0.5.0-rc1 <http://html2canvas.hertzen.com>
2+
html2canvas 0.5.0-alpha <http://html2canvas.hertzen.com>
33
Copyright (c) 2014 Niklas von Hertzen
44
55
Released under MIT License
@@ -420,6 +420,32 @@ function LinearGradientContainer(imageData) {
420420
this.x1 = x0;
421421
this.y1 = y0;
422422
break;
423+
default:
424+
var angle = position.match(this.angleRegExp);
425+
if (angle) {
426+
switch(angle[2]) {
427+
case "deg":
428+
var angleDeg = parseFloat(angle[1]);
429+
var radians = angleDeg / (180 / Math.PI);
430+
var slope = Math.tan(radians); // m
431+
432+
var perpendicularSlope = -1 / slope;
433+
434+
435+
436+
// y = 2
437+
// y = m * x
438+
// 2 = m * x
439+
440+
this.y0 = 2 / Math.tan(slope) / 2; // 1
441+
// console.log(radians, angle);
442+
this.x0 = 0;
443+
this.x1 = 1;
444+
this.y1 = 0;
445+
446+
break;
447+
}
448+
}
423449
}
424450
}, this);
425451
} else {

dist/html2canvas.min.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ <h1>
171171
<p style="color: black; font-size: 1em; line-height: 1.3em; clear: both">
172172
This is a nonsensical document, but syntactically valid HTML 4.0. All 100% conformant CSS1 agents should be able to render the document elements above this paragraph <b>indistinguishably</b> (to the pixel) from this reference rendering, (except font rasterization and form widgets). All discrepancies should be traceable to CSS1 implementation shortcomings. Once you have finished evaluating this test, you can return to the <A HREF="sec5526c.htm" style="text-decoration:none">parent page</A>.
173173
</p>
174-
<script type="text/javascript" src="../build/html2canvas.js"></script>
174+
<script type="text/javascript" src="../dist/html2canvas.js"></script>
175175
<script type="text/javascript">
176176
html2canvas(document.body, {
177177
onrendered: function(canvas) {

examples/demo2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h2>More content</h2>
5353

5454
</div>
5555
</div>
56-
<script type="text/javascript" src="../build/html2canvas.js"></script>
56+
<script type="text/javascript" src="../dist/html2canvas.js"></script>
5757
<script type="text/javascript">
5858
html2canvas(document.body, {
5959
onrendered: function(canvas) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"title": "html2canvas",
33
"name": "html2canvas",
44
"description": "Screenshots with JavaScript",
5-
"version": "0.5.0-rc1",
5+
"version": "0.5.0-alpha",
66
"author": {
77
"name": "Niklas von Hertzen",
88
"email": "niklasvh@gmail.com",
@@ -20,7 +20,7 @@
2020
"url": "https://github.com/niklasvh/html2canvas/issues"
2121
},
2222
"devDependencies": {
23-
"baconjs": "0.7.11",
23+
"baconjs": "^0.7.11",
2424
"base64-arraybuffer": ">= 0.1.0",
2525
"grunt": "^0.4.5",
2626
"grunt-contrib-concat": "*",
@@ -31,7 +31,7 @@
3131
"grunt-contrib-watch": "~0.5.1",
3232
"lodash": "^2.4.1",
3333
"png-js": ">= 0.1.1",
34-
"wd": "0.2.21"
34+
"wd": "^0.2.21"
3535
},
3636
"scripts": {
3737
"test": "grunt travis --verbose"

tests/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var h2cSelector, h2cOptions;
1414
var html2canvas = ['log', 'nodecontainer', 'stackingcontext', 'textcontainer', 'support', 'imagecontainer', 'dummyimagecontainer', 'proxyimagecontainer', 'gradientcontainer', 'lineargradientcontainer', 'webkitgradientcontainer',
1515
'imageloader', 'nodeparser', 'font', 'fontmetrics', 'core', 'renderer', 'promise', 'renderers/canvas'], i;
1616
if (window.location.search === "?selenium") {
17-
document.write(srcStart + '/build/html2canvas.js' + scrEnd);
17+
document.write(srcStart + '/dist/html2canvas.js' + scrEnd);
1818
} else {
1919
for (i = 0; i < html2canvas.length; ++i) {
2020
document.write(srcStart + '/src/' + html2canvas[i] + '.js?' + Math.random() + scrEnd);

0 commit comments

Comments
 (0)