Compare commits

...

12 Commits

Author SHA1 Message Date
greenkeeper[bot]
7647111125 chore(package): update docdash to version 1.0.2
Closes #335
2019-01-03 10:22:07 +00:00
Karishma Chadha
7d8bcafe2b Merge pull request #384 from ktbee/pixel-center-bounding-box
Align the bounding box to the center of the pixel instead of top left
2018-12-26 10:28:37 -05:00
Katie Broida
770ae92b25 Align the bounding box to the center of the pixel instead of top left 2018-12-21 16:51:36 -05:00
DD Liu
401c368ebc Merge pull request #383 from fsih/updateNewlines
update svg renderer
2018-12-20 14:28:18 -05:00
DD
4eb04896d3 update svg renderer 2018-12-20 14:06:14 -05:00
DD Liu
ca488e6439 Merge pull request #380 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20181218153528
Update scratch-svg-renderer to the latest version 🚀
2018-12-18 10:56:10 -05:00
greenkeeper[bot]
0de5befa4f fix(package): update scratch-svg-renderer to version 0.2.0-prerelease.20181218153528 2018-12-18 15:36:46 +00:00
DD Liu
322e311b17 Merge pull request #379 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20181213192400
fix(package): update scratch-svg-renderer to version 0.2.0-prerelease…
2018-12-13 15:42:20 -05:00
greenkeeper[bot]
2394fb5610 fix(package): update scratch-svg-renderer to version 0.2.0-prerelease.20181213192400
Closes #378
2018-12-13 20:08:32 +00:00
DD Liu
109507f6fe Merge pull request #377 from LLK/greenkeeper/scratch-svg-renderer-0.2.0-prerelease.20181212190400
Update scratch-svg-renderer to the latest version 🚀
2018-12-12 18:30:48 -05:00
DD Liu
9292bacdae Update package.json 2018-12-12 18:17:29 -05:00
greenkeeper[bot]
c6a4aa870e fix(package): update scratch-svg-renderer to version 0.2.0-prerelease.20181212190400 2018-12-12 19:05:19 +00:00
2 changed files with 6 additions and 4 deletions

View File

@@ -31,7 +31,7 @@
"babel-preset-env": "^1.6.1",
"chromeless": "^1.5.1",
"copy-webpack-plugin": "^4.5.1",
"docdash": "^0.4.0",
"docdash": "^1.0.2",
"eslint": "^4.6.1",
"eslint-config-scratch": "^5.0.0",
"gh-pages": "^1.0.0",
@@ -53,7 +53,7 @@
"minilog": "3.1.0",
"raw-loader": "^0.5.1",
"scratch-storage": "^1.0.0",
"scratch-svg-renderer": "0.2.0-prerelease.20181126212715",
"scratch-svg-renderer": "0.2.0-prerelease.20181220183040",
"twgl.js": "4.4.0"
}
}

View File

@@ -536,13 +536,15 @@ class Drawable {
_getTransformedHullPoints () {
const projection = twgl.m4.ortho(-1, 1, -1, 1, -1, 1);
const skinSize = this.skin.size;
const halfXPixel = 1 / skinSize[0] / 2;
const halfYPixel = 1 / skinSize[1] / 2;
const tm = twgl.m4.multiply(this._uniforms.u_modelMatrix, projection);
const transformedHullPoints = [];
for (let i = 0; i < this._convexHullPoints.length; i++) {
const point = this._convexHullPoints[i];
const glPoint = twgl.v3.create(
0.5 + (-point[0] / skinSize[0]),
(point[1] / skinSize[1]) - 0.5,
0.5 + (-point[0] / skinSize[0]) - halfXPixel,
(point[1] / skinSize[1]) - 0.5 + halfYPixel,
0
);
twgl.m4.transformPoint(tm, glPoint, glPoint);