Compare commits
28 Commits
greenkeepe
...
greenkeepe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37473f061a | ||
|
|
6cff0f984f | ||
|
|
7c5b41b97e | ||
|
|
21157455cf | ||
|
|
d35a3205bd | ||
|
|
eab4ad95f6 | ||
|
|
e8ba24a43e | ||
|
|
ae16a64e78 | ||
|
|
905a346161 | ||
|
|
889d62c9d7 | ||
|
|
afa07d20ad | ||
|
|
1230dab7eb | ||
|
|
e7ef981a51 | ||
|
|
b89c938b15 | ||
|
|
8caeac6e6a | ||
|
|
ab8fda1655 | ||
|
|
5579f121a9 | ||
|
|
a8831a8e8e | ||
|
|
6119fba08e | ||
|
|
66d477b3ac | ||
|
|
2e22344b0c | ||
|
|
6aac0854eb | ||
|
|
7442cc945b | ||
|
|
6b393ecc39 | ||
|
|
4a4173046a | ||
|
|
041de9e157 | ||
|
|
bfefdfc552 | ||
|
|
3be6a4d4a8 |
19
package.json
19
package.json
@@ -26,12 +26,11 @@
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.23.1",
|
||||
"babel-eslint": "^8.2.1",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-loader": "^7.1.4",
|
||||
"babel-polyfill": "^6.22.0",
|
||||
"babel-preset-es2015": "^6.22.0",
|
||||
"base64-loader": "^1.0.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"chromeless": "^1.5.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"copy-webpack-plugin": "^4.5.1",
|
||||
"docdash": "^0.4.0",
|
||||
"eslint": "^4.6.1",
|
||||
"eslint-config-scratch": "^5.0.0",
|
||||
@@ -44,13 +43,15 @@
|
||||
"linebreak": "0.3.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"scratch-storage": "^0.4.0",
|
||||
"scratch-svg-renderer": "0.1.0-prerelease.20180423193917",
|
||||
"scratch-vm": "0.1.0-prerelease.1524520946",
|
||||
"tap": "^11.0.0",
|
||||
"scratch-svg-renderer": "0.1.0-prerelease.20180514170126",
|
||||
"scratch-vm": "0.1.0-prerelease.1525975472",
|
||||
"tap": "^12.0.0",
|
||||
"travis-after-all": "^1.4.4",
|
||||
"twgl.js": "4.4.0",
|
||||
"webpack": "^3.10.0",
|
||||
"webpack-dev-server": "^2.8.2",
|
||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||
"webpack": "^4.8.0",
|
||||
"webpack-cli": "^2.0.15",
|
||||
"webpack-dev-server": "^3.1.4",
|
||||
"xml-escape": "1.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ class RenderWebGL extends EventEmitter {
|
||||
/**
|
||||
* Update an existing bitmap skin, or create a bitmap skin if the previous skin was not bitmap.
|
||||
* @param {!int} skinId the ID for the skin to change.
|
||||
* @param {!string} imgData - new bitmap to use.
|
||||
* @param {!ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} imgData - new contents for this skin.
|
||||
* @param {!number} bitmapResolution - the resolution scale for a bitmap costume.
|
||||
* @param {?Array<number>} rotationCenter Optional: rotation center of the skin. If not supplied, the center of the
|
||||
* skin will be used
|
||||
|
||||
@@ -79,6 +79,7 @@ class Silhouette {
|
||||
* @return {boolean} If the nearest pixel has an alpha value.
|
||||
*/
|
||||
isTouchingNearest (vec) {
|
||||
if (!this._data) return;
|
||||
return getPoint(
|
||||
this,
|
||||
Math.round(vec[0] * (this._width - 1)),
|
||||
@@ -93,6 +94,7 @@ class Silhouette {
|
||||
* @return {boolean} Any of the pixels have some alpha.
|
||||
*/
|
||||
isTouchingLinear (vec) {
|
||||
if (!this._data) return;
|
||||
const x = Math.floor(vec[0] * (this._width - 1));
|
||||
const y = Math.floor(vec[1] * (this._height - 1));
|
||||
return getPoint(this, x, y) > 0 ||
|
||||
|
||||
@@ -149,7 +149,8 @@ class SVGTextBubble {
|
||||
}
|
||||
|
||||
_textFragment () {
|
||||
return `<text fill="#575E75">${xmlescape(this.lines.join('\n'))}</text>`;
|
||||
const attrs = `font-family="Helvetica, Arial, sans-serif" font-size="14px" fill="#575E75"`;
|
||||
return `<text ${attrs}>${xmlescape(this.lines.join('\n'))}</text>`;
|
||||
}
|
||||
|
||||
buildString (type, text, pointsLeft) {
|
||||
|
||||
@@ -67,7 +67,10 @@ class SVGMeasurementProvider {
|
||||
// @TODO This code should be shared with the svg-renderer.
|
||||
svgText.setAttribute('alignment-baseline', 'text-before-edge');
|
||||
svgText.setAttribute('font-size', '14');
|
||||
svgText.setAttribute('font-family', 'Helvetica');
|
||||
|
||||
// TODO Do we want to use the new default sans font instead of Helvetica?
|
||||
// This change intentionally subverts the svg-renderer auto font conversion.
|
||||
svgText.setAttribute('font-family', 'Helvetica, Arial, sans-serif');
|
||||
|
||||
// hide from the user, including screen readers
|
||||
svgRoot.setAttribute('style', 'position:absolute;visibility:hidden');
|
||||
|
||||
@@ -35,9 +35,11 @@ const testFile = file => test(file, async t => {
|
||||
return Promise.resolve()
|
||||
.then(async () => {
|
||||
// waiting for all threads to complete, then we return
|
||||
while (vm.runtime.threads.length > 0) {
|
||||
while (vm.runtime.threads.some(thread => vm.runtime.isActiveThread(thread))) {
|
||||
if ((Date.now() - startTime) >= TIMEOUT) {
|
||||
messages.push(`fail Threads still running after ${TIMEOUT}ms`);
|
||||
// if we push the message after end, the failure from tap is not very useful:
|
||||
// "not ok test after end() was called"
|
||||
messages.unshift(`fail Threads still running after ${TIMEOUT}ms`);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
|
||||
const base = {
|
||||
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
||||
devServer: {
|
||||
contentBase: false,
|
||||
host: '0.0.0.0',
|
||||
@@ -18,7 +19,7 @@ const base = {
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['es2015']
|
||||
presets: [['env', {targets: {browsers: ['last 3 versions', 'Safari >= 8', 'iOS >= 8']}}]]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -27,12 +28,14 @@ const base = {
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: process.env.NODE_ENV === 'production' ? [
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
include: /\.min\.js$/,
|
||||
minimize: true
|
||||
})
|
||||
] : []
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
include: /\.min\.js$/
|
||||
})
|
||||
]
|
||||
},
|
||||
plugins: []
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
|
||||
Reference in New Issue
Block a user