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
|
||||
# Follow https://github.com/nodejs/LTS to decide when to remove a version
|
||||
node_js:
|
||||
- stable
|
||||
- '7'
|
||||
- '6'
|
||||
- '4'
|
||||
sudo: false
|
||||
env:
|
||||
matrix:
|
||||
|
@ -42,3 +39,14 @@ script:
|
|||
- gulp test
|
||||
- gulp zip
|
||||
- '[ "${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.
|
||||
*
|
||||
* 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) {
|
||||
|
||||
self = self || require('./node/self.js');
|
||||
var window = self.window,
|
||||
var window = self.window ? self.window : self,
|
||||
document = self.document;
|
||||
|
||||
var Base = new function() {
|
||||
|
@ -4525,6 +4525,7 @@ new function() {
|
|||
half = size / 2;
|
||||
ctx.strokeStyle = ctx.fillStyle = color
|
||||
? color.toCanvasStyle(ctx) : '#009dec';
|
||||
ctx.lineWidth=2.5;
|
||||
if (itemSelected)
|
||||
this._drawSelected(ctx, mx, selectionItems);
|
||||
if (positionSelected) {
|
||||
|
@ -8888,7 +8889,7 @@ var Path = PathItem.extend({
|
|||
}),
|
||||
new function() {
|
||||
|
||||
function drawHandles(ctx, segments, matrix, size) {
|
||||
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||
var half = size / 2,
|
||||
coords = new Array(6),
|
||||
pX, pY;
|
||||
|
@ -8900,10 +8901,12 @@ new function() {
|
|||
ctx.beginPath();
|
||||
ctx.moveTo(pX, pY);
|
||||
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.beginPath();
|
||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8913,17 +8916,19 @@ new function() {
|
|||
segment._transformCoordinates(matrix, coords);
|
||||
pX = coords[0];
|
||||
pY = coords[1];
|
||||
if (selection & 2)
|
||||
if (selection & 2 && !isFullySelected)
|
||||
drawHandle(2);
|
||||
if (selection & 4)
|
||||
if (selection & 4 && !isFullySelected)
|
||||
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)) {
|
||||
var fillStyle = ctx.fillStyle;
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2);
|
||||
ctx.fillStyle = fillStyle;
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||
}
|
||||
ctx.fill();
|
||||
ctx.fillStyle = fillStyle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
31
dist/paper-full.js
vendored
31
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 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) {
|
||||
|
||||
self = self || require('./node/self.js');
|
||||
var window = self.window,
|
||||
var window = self.window ? self.window : self,
|
||||
document = self.document;
|
||||
|
||||
var Base = new function() {
|
||||
|
@ -4525,6 +4525,7 @@ new function() {
|
|||
half = size / 2;
|
||||
ctx.strokeStyle = ctx.fillStyle = color
|
||||
? color.toCanvasStyle(ctx) : '#009dec';
|
||||
ctx.lineWidth=2.5;
|
||||
if (itemSelected)
|
||||
this._drawSelected(ctx, mx, selectionItems);
|
||||
if (positionSelected) {
|
||||
|
@ -8888,7 +8889,7 @@ var Path = PathItem.extend({
|
|||
}),
|
||||
new function() {
|
||||
|
||||
function drawHandles(ctx, segments, matrix, size) {
|
||||
function drawHandles(ctx, segments, matrix, size, isFullySelected) {
|
||||
var half = size / 2,
|
||||
coords = new Array(6),
|
||||
pX, pY;
|
||||
|
@ -8900,10 +8901,12 @@ new function() {
|
|||
ctx.beginPath();
|
||||
ctx.moveTo(pX, pY);
|
||||
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.beginPath();
|
||||
ctx.arc(hX, hY, half, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8913,17 +8916,19 @@ new function() {
|
|||
segment._transformCoordinates(matrix, coords);
|
||||
pX = coords[0];
|
||||
pY = coords[1];
|
||||
if (selection & 2)
|
||||
if (selection & 2 && !isFullySelected)
|
||||
drawHandle(2);
|
||||
if (selection & 4)
|
||||
if (selection & 4 && !isFullySelected)
|
||||
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)) {
|
||||
var fillStyle = ctx.fillStyle;
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2);
|
||||
ctx.fillStyle = fillStyle;
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||
}
|
||||
ctx.fill();
|
||||
ctx.fillStyle = fillStyle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,9 +34,10 @@ if (argv.branch && argv.branch !== options.branch) {
|
|||
var version = options.version,
|
||||
branch = options.branch;
|
||||
|
||||
// If we're not on the master branch, use the branch name as a suffix:
|
||||
if (branch !== 'master')
|
||||
options.version += '-' + branch;
|
||||
// Take this out for now to reduce changes every build
|
||||
// // If we're not on the master branch, use the branch name as a suffix:
|
||||
// if (branch !== 'master')
|
||||
// options.version += '-' + branch;
|
||||
|
||||
// Allow the removal of the suffix again, as needed by the publish task.
|
||||
options.resetVersion = function() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "paper",
|
||||
"name": "@scratch/paper",
|
||||
"version": "0.11.5",
|
||||
"description": "The Swiss Army Knife of Vector Graphics Scripting",
|
||||
"license": "MIT",
|
||||
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"acorn": "~0.5.0",
|
||||
"canvas": "^1.3.5",
|
||||
"canvas-prebuilt": "^1.6.5-prerelease.1",
|
||||
"del": "^2.2.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-cached": "^1.1.0",
|
||||
|
|
|
@ -31,5 +31,5 @@
|
|||
// 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.
|
||||
self = self || require('./node/self.js');
|
||||
var window = self.window,
|
||||
var window = self.window ? self.window : self,
|
||||
document = self.document;
|
||||
|
|
Loading…
Reference in a new issue