Compare commits
1 Commits
greenkeepe
...
greenkeepe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c86ffcf3a |
@@ -26,7 +26,7 @@
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.23.1",
|
||||
"babel-eslint": "^8.2.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-loader": "^7.1.4",
|
||||
"babel-polyfill": "^6.22.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"chromeless": "^1.5.1",
|
||||
@@ -40,7 +40,7 @@
|
||||
"scratch-vm": "0.2.0-prerelease.20181024204838",
|
||||
"tap": "^11.0.0",
|
||||
"travis-after-all": "^1.4.4",
|
||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||
"uglifyjs-webpack-plugin": "^2.1.0",
|
||||
"webpack": "^4.8.0",
|
||||
"webpack-cli": "^3.1.0",
|
||||
"webpack-dev-server": "^3.1.4"
|
||||
|
||||
@@ -426,16 +426,16 @@ class Drawable {
|
||||
* Should the drawable use NEAREST NEIGHBOR or LINEAR INTERPOLATION mode
|
||||
*/
|
||||
get useNearest () {
|
||||
// Raster skins (bitmaps) should always prefer nearest neighbor
|
||||
if (this.skin.isRaster) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// We can't use nearest neighbor unless we are a multiple of 90 rotation
|
||||
if (this._direction % 90 !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Raster skins (bitmaps) should always prefer nearest neighbor
|
||||
if (this.skin.isRaster) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the scale of the skin is very close to 100 (0.99999 variance is okay I guess)
|
||||
if (Math.abs(this.scale[0]) > 99 && Math.abs(this.scale[0]) < 101 &&
|
||||
Math.abs(this.scale[1]) > 99 && Math.abs(this.scale[1]) < 101) {
|
||||
@@ -536,15 +536,13 @@ 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]) - halfXPixel,
|
||||
(point[1] / skinSize[1]) - 0.5 + halfYPixel,
|
||||
0.5 + (-point[0] / skinSize[0]),
|
||||
(point[1] / skinSize[1]) - 0.5,
|
||||
0
|
||||
);
|
||||
twgl.m4.transformPoint(tm, glPoint, glPoint);
|
||||
|
||||
Reference in New Issue
Block a user