Compare commits

...

28 Commits

Author SHA1 Message Date
greenkeeper[bot]
37473f061a chore(package): update tap to version 12.0.0 2018-05-17 18:44:57 +00:00
Paul Kaplan
6cff0f984f Merge pull request #283 from paulkaplan/update-with-built-fonts
Update the scratch-svg-renderer config
2018-05-14 13:20:58 -04:00
Paul Kaplan
7c5b41b97e Update the scratch-svg-renderer config 2018-05-14 13:18:26 -04:00
Paul Kaplan
21157455cf Merge pull request #282 from paulkaplan/font-bubble
Actually fix the font in the say bubbles
2018-05-11 14:42:42 -04:00
Paul Kaplan
d35a3205bd Actually fix the font in the say bubbles 2018-05-11 14:41:39 -04:00
Paul Kaplan
eab4ad95f6 Merge pull request #281 from paulkaplan/fix-silhouette
Prevent errors when testing empty silhouettes
2018-05-11 14:07:24 -04:00
Paul Kaplan
e8ba24a43e Prevent errors when testing empty silhouettes 2018-05-11 14:05:16 -04:00
Paul Kaplan
ae16a64e78 Merge pull request #280 from paulkaplan/subvert-font-converter
Subvert the font converter to maintain the font in text bubbles
2018-05-11 13:25:15 -04:00
Paul Kaplan
905a346161 Subvert the font converter to maintain the font in text bubbles 2018-05-11 13:23:13 -04:00
DD Liu
889d62c9d7 Merge pull request #279 from fsih/addSvgRenderDep
Update svg renderer
2018-05-11 11:04:02 -04:00
DD
afa07d20ad Update svg renderer 2018-05-11 11:03:22 -04:00
DD Liu
1230dab7eb Merge pull request #276 from fsih/updateSvgRenderer2
Attempt 2 at adding scratch-svg-renderer module update
2018-05-10 17:02:28 -04:00
DD
e7ef981a51 Merge branch 'develop' into updateSvgRenderer2 2018-05-10 16:57:07 -04:00
DD
b89c938b15 add back vm 2018-05-10 16:56:49 -04:00
DD Liu
8caeac6e6a Merge pull request #278 from gnarf/fix-integration-test
Fix a thread status check in integration tests to allow "done" threads
2018-05-10 16:56:20 -04:00
Corey Frang
ab8fda1655 Even simpler way to check that some thread is active 2018-05-10 16:17:38 -04:00
Corey Frang
5579f121a9 Fix a thread status check in integration tests to allow "done" threads 2018-05-10 16:13:10 -04:00
DD
a8831a8e8e Try only updating svg renderer 2018-05-10 16:04:28 -04:00
DD Liu
6119fba08e Merge pull request #275 from LLK/revert-274-updateSvgRenderer
Revert "Update svg renderer and vm. These contain font changes"
2018-05-10 14:58:12 -04:00
DD Liu
66d477b3ac Revert "Update svg renderer and vm. These contain font changes" 2018-05-10 14:53:43 -04:00
DD Liu
2e22344b0c Merge pull request #274 from fsih/updateSvgRenderer
Update svg renderer and vm. These contain font changes
2018-05-10 14:40:47 -04:00
DD
6aac0854eb update svg renderer and vm. These contain font changes' 2018-05-10 14:39:48 -04:00
Ray Schamp
7442cc945b Merge pull request #271 from mzgoddard/babel-preset-env
Replace babel-preset-es2015 with babel-preset-env
2018-05-08 16:47:14 -04:00
Michael "Z" Goddard
6b393ecc39 Replace babel-preset-es2015 with babel-preset-env 2018-05-08 16:46:06 -04:00
Ray Schamp
4a4173046a Merge pull request #270 from mzgoddard/webpack-4
Update to webpack 4
2018-05-08 12:57:25 -04:00
Michael "Z" Goddard
041de9e157 Update to webpack 4
- Remove unused base64-loader
2018-05-07 12:18:39 -04:00
DD Liu
bfefdfc552 Merge pull request #269 from fsih/updateBitmapSkinJsdoc
Fix jsdoc
2018-05-04 10:36:22 -04:00
DD
3be6a4d4a8 Fix jsdoc 2018-05-04 10:22:47 -04:00
7 changed files with 34 additions and 22 deletions

View File

@@ -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"
}
}

View File

@@ -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

View File

@@ -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 ||

View File

@@ -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) {

View File

@@ -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');

View File

@@ -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;
}

View File

@@ -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 = [