Also pass in drawable to useNearest

This makes the code messier but I'm not sure what else to do since the
texture filtering method to be used depends on the drawable's properties
(e.g. transform, enabled effects). We still need to pass in the scale
separately because in the main rendering path, we multiply it by the
screen-space scale factor.
This commit is contained in:
adroitwhiz
2020-07-28 09:01:11 -04:00
parent f4d5e52a8f
commit 26d2677409
4 changed files with 10 additions and 7 deletions

View File

@@ -59,9 +59,9 @@ class SVGSkin extends Skin {
return this._svgRenderer.size;
}
useNearest (scale) {
useNearest (scale, drawable) {
// If the effect bits for mosaic, pixelate, whirl, or fisheye are set, use linear
if ((this.enabledEffects & (
if ((drawable.enabledEffects & (
ShaderManager.EFFECT_INFO.fisheye.mask |
ShaderManager.EFFECT_INFO.whirl.mask |
ShaderManager.EFFECT_INFO.pixelate.mask |
@@ -71,7 +71,7 @@ class SVGSkin extends Skin {
}
// We can't use nearest neighbor unless we are a multiple of 90 rotation
if (this._direction % 90 !== 0) {
if (drawable._direction % 90 !== 0) {
return false;
}