mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Fix tests and make Travis deploy scratch paperjs
This commit is contained in:
parent
2d790a3f34
commit
fd1435d94d
6 changed files with 54 additions and 35 deletions
14
.travis.yml
14
.travis.yml
|
@ -1,10 +1,7 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
# Follow https://github.com/nodejs/LTS to decide when to remove a version
|
# Follow https://github.com/nodejs/LTS to decide when to remove a version
|
||||||
node_js:
|
node_js:
|
||||||
- stable
|
|
||||||
- '7'
|
|
||||||
- '6'
|
- '6'
|
||||||
- '4'
|
|
||||||
sudo: false
|
sudo: false
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -42,3 +39,14 @@ script:
|
||||||
- gulp test
|
- gulp test
|
||||||
- gulp zip
|
- gulp zip
|
||||||
- '[ "${TRAVIS_BRANCH}" = "develop" ] && [ "${TRAVIS_NODE_VERSION}" = "stable" ] && travis/deploy-prebuilt.sh || true'
|
- '[ "${TRAVIS_BRANCH}" = "develop" ] && [ "${TRAVIS_NODE_VERSION}" = "stable" ] && travis/deploy-prebuilt.sh || true'
|
||||||
|
before_deploy:
|
||||||
|
- npm --no-git-tag-version version 0.11.$(date +%Y%m%d%H%M%S)
|
||||||
|
- git config --global user.email $(git log --pretty=format:"%ae" -n1)
|
||||||
|
- git config --global user.name $(git log --pretty=format:"%an" -n1)
|
||||||
|
deploy:
|
||||||
|
- provider: npm
|
||||||
|
on:
|
||||||
|
branch: develop
|
||||||
|
skip_cleanup: true
|
||||||
|
email: $NPM_EMAIL
|
||||||
|
api_key: $NPM_TOKEN
|
||||||
|
|
31
dist/paper-core.js
vendored
31
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Thu Oct 5 16:16:29 2017 +0200
|
* Date: Mon Dec 4 16:36:52 2017 -0500
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
var paper = function(self, undefined) {
|
var paper = function(self, undefined) {
|
||||||
|
|
||||||
self = self || require('./node/self.js');
|
self = self || require('./node/self.js');
|
||||||
var window = self.window,
|
var window = self.window ? self.window : self,
|
||||||
document = self.document;
|
document = self.document;
|
||||||
|
|
||||||
var Base = new function() {
|
var Base = new function() {
|
||||||
|
@ -4525,6 +4525,7 @@ new function() {
|
||||||
half = size / 2;
|
half = size / 2;
|
||||||
ctx.strokeStyle = ctx.fillStyle = color
|
ctx.strokeStyle = ctx.fillStyle = color
|
||||||
? color.toCanvasStyle(ctx) : '#009dec';
|
? color.toCanvasStyle(ctx) : '#009dec';
|
||||||
|
ctx.lineWidth=2.5;
|
||||||
if (itemSelected)
|
if (itemSelected)
|
||||||
this._drawSelected(ctx, mx, selectionItems);
|
this._drawSelected(ctx, mx, selectionItems);
|
||||||
if (positionSelected) {
|
if (positionSelected) {
|
||||||
|
@ -8888,7 +8889,7 @@ var Path = PathItem.extend({
|
||||||
}),
|
}),
|
||||||
new function() {
|
new function() {
|
||||||
|
|
||||||
function drawHandles(ctx, segments, matrix, size) {
|
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||||
var half = size / 2,
|
var half = size / 2,
|
||||||
coords = new Array(6),
|
coords = new Array(6),
|
||||||
pX, pY;
|
pX, pY;
|
||||||
|
@ -8900,10 +8901,12 @@ new function() {
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(pX, pY);
|
ctx.moveTo(pX, pY);
|
||||||
ctx.lineTo(hX, hY);
|
ctx.lineTo(hX, hY);
|
||||||
|
ctx.moveTo(hX - half, hY);
|
||||||
|
ctx.lineTo(hX, hY + half);
|
||||||
|
ctx.lineTo(hX + half, hY);
|
||||||
|
ctx.lineTo(hX, hY - half);
|
||||||
|
ctx.closePath();
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
ctx.beginPath();
|
|
||||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
|
||||||
ctx.fill();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8913,17 +8916,19 @@ new function() {
|
||||||
segment._transformCoordinates(matrix, coords);
|
segment._transformCoordinates(matrix, coords);
|
||||||
pX = coords[0];
|
pX = coords[0];
|
||||||
pY = coords[1];
|
pY = coords[1];
|
||||||
if (selection & 2)
|
if (selection & 2 && !isFullySelected)
|
||||||
drawHandle(2);
|
drawHandle(2);
|
||||||
if (selection & 4)
|
if (selection & 4 && !isFullySelected)
|
||||||
drawHandle(4);
|
drawHandle(4);
|
||||||
ctx.fillRect(pX - half, pY - half, size, size);
|
ctx.beginPath();
|
||||||
|
ctx.arc(pX, pY, half, 0, Math.PI * 2, true);
|
||||||
|
ctx.stroke();
|
||||||
|
var fillStyle = ctx.fillStyle;
|
||||||
if (!(selection & 1)) {
|
if (!(selection & 1)) {
|
||||||
var fillStyle = ctx.fillStyle;
|
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||||
ctx.fillStyle = '#ffffff';
|
|
||||||
ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2);
|
|
||||||
ctx.fillStyle = fillStyle;
|
|
||||||
}
|
}
|
||||||
|
ctx.fill();
|
||||||
|
ctx.fillStyle = fillStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
31
dist/paper-full.js
vendored
31
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Thu Oct 5 16:16:29 2017 +0200
|
* Date: Mon Dec 4 16:36:52 2017 -0500
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
var paper = function(self, undefined) {
|
var paper = function(self, undefined) {
|
||||||
|
|
||||||
self = self || require('./node/self.js');
|
self = self || require('./node/self.js');
|
||||||
var window = self.window,
|
var window = self.window ? self.window : self,
|
||||||
document = self.document;
|
document = self.document;
|
||||||
|
|
||||||
var Base = new function() {
|
var Base = new function() {
|
||||||
|
@ -4525,6 +4525,7 @@ new function() {
|
||||||
half = size / 2;
|
half = size / 2;
|
||||||
ctx.strokeStyle = ctx.fillStyle = color
|
ctx.strokeStyle = ctx.fillStyle = color
|
||||||
? color.toCanvasStyle(ctx) : '#009dec';
|
? color.toCanvasStyle(ctx) : '#009dec';
|
||||||
|
ctx.lineWidth=2.5;
|
||||||
if (itemSelected)
|
if (itemSelected)
|
||||||
this._drawSelected(ctx, mx, selectionItems);
|
this._drawSelected(ctx, mx, selectionItems);
|
||||||
if (positionSelected) {
|
if (positionSelected) {
|
||||||
|
@ -8888,7 +8889,7 @@ var Path = PathItem.extend({
|
||||||
}),
|
}),
|
||||||
new function() {
|
new function() {
|
||||||
|
|
||||||
function drawHandles(ctx, segments, matrix, size) {
|
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||||
var half = size / 2,
|
var half = size / 2,
|
||||||
coords = new Array(6),
|
coords = new Array(6),
|
||||||
pX, pY;
|
pX, pY;
|
||||||
|
@ -8900,10 +8901,12 @@ new function() {
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(pX, pY);
|
ctx.moveTo(pX, pY);
|
||||||
ctx.lineTo(hX, hY);
|
ctx.lineTo(hX, hY);
|
||||||
|
ctx.moveTo(hX - half, hY);
|
||||||
|
ctx.lineTo(hX, hY + half);
|
||||||
|
ctx.lineTo(hX + half, hY);
|
||||||
|
ctx.lineTo(hX, hY - half);
|
||||||
|
ctx.closePath();
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
ctx.beginPath();
|
|
||||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
|
||||||
ctx.fill();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8913,17 +8916,19 @@ new function() {
|
||||||
segment._transformCoordinates(matrix, coords);
|
segment._transformCoordinates(matrix, coords);
|
||||||
pX = coords[0];
|
pX = coords[0];
|
||||||
pY = coords[1];
|
pY = coords[1];
|
||||||
if (selection & 2)
|
if (selection & 2 && !isFullySelected)
|
||||||
drawHandle(2);
|
drawHandle(2);
|
||||||
if (selection & 4)
|
if (selection & 4 && !isFullySelected)
|
||||||
drawHandle(4);
|
drawHandle(4);
|
||||||
ctx.fillRect(pX - half, pY - half, size, size);
|
ctx.beginPath();
|
||||||
|
ctx.arc(pX, pY, half, 0, Math.PI * 2, true);
|
||||||
|
ctx.stroke();
|
||||||
|
var fillStyle = ctx.fillStyle;
|
||||||
if (!(selection & 1)) {
|
if (!(selection & 1)) {
|
||||||
var fillStyle = ctx.fillStyle;
|
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||||
ctx.fillStyle = '#ffffff';
|
|
||||||
ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2);
|
|
||||||
ctx.fillStyle = fillStyle;
|
|
||||||
}
|
}
|
||||||
|
ctx.fill();
|
||||||
|
ctx.fillStyle = fillStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,10 @@ if (argv.branch && argv.branch !== options.branch) {
|
||||||
var version = options.version,
|
var version = options.version,
|
||||||
branch = options.branch;
|
branch = options.branch;
|
||||||
|
|
||||||
// If we're not on the master branch, use the branch name as a suffix:
|
// Take this out for now to reduce changes every build
|
||||||
if (branch !== 'master')
|
// // If we're not on the master branch, use the branch name as a suffix:
|
||||||
options.version += '-' + branch;
|
// if (branch !== 'master')
|
||||||
|
// options.version += '-' + branch;
|
||||||
|
|
||||||
// Allow the removal of the suffix again, as needed by the publish task.
|
// Allow the removal of the suffix again, as needed by the publish task.
|
||||||
options.resetVersion = function() {
|
options.resetVersion = function() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "paper",
|
"name": "@scratch/paper",
|
||||||
"version": "0.11.5",
|
"version": "0.11.5",
|
||||||
"description": "The Swiss Army Knife of Vector Graphics Scripting",
|
"description": "The Swiss Army Knife of Vector Graphics Scripting",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"acorn": "~0.5.0",
|
"acorn": "~0.5.0",
|
||||||
"canvas": "^1.3.5",
|
"canvas-prebuilt": "^1.6.5-prerelease.1",
|
||||||
"del": "^2.2.1",
|
"del": "^2.2.1",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-cached": "^1.1.0",
|
"gulp-cached": "^1.1.0",
|
||||||
|
|
|
@ -31,5 +31,5 @@
|
||||||
// NOTE: We're not modifying the global `self` here. We receive its value passed
|
// NOTE: We're not modifying the global `self` here. We receive its value passed
|
||||||
// to the paper.js function scope, and this is the one that is modified here.
|
// to the paper.js function scope, and this is the one that is modified here.
|
||||||
self = self || require('./node/self.js');
|
self = self || require('./node/self.js');
|
||||||
var window = self.window,
|
var window = self.window ? self.window : self,
|
||||||
document = self.document;
|
document = self.document;
|
||||||
|
|
Loading…
Reference in a new issue