Compare commits
12 Commits
greenkeepe
...
greenkeepe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7647111125 | ||
|
|
7d8bcafe2b | ||
|
|
770ae92b25 | ||
|
|
401c368ebc | ||
|
|
4eb04896d3 | ||
|
|
ca488e6439 | ||
|
|
0de5befa4f | ||
|
|
322e311b17 | ||
|
|
2394fb5610 | ||
|
|
109507f6fe | ||
|
|
9292bacdae | ||
|
|
c6a4aa870e |
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user