Skip to content

Commit

Permalink
remove unnecessary negation
Browse files Browse the repository at this point in the history
  • Loading branch information
adroitwhiz committed May 5, 2020
1 parent 6a212a0 commit 8317671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EffectTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ class EffectTransform {
dst[1] = (dst[1] - skinUniforms.u_logicalBounds[1]) /
(skinUniforms.u_logicalBounds[3] - skinUniforms.u_logicalBounds[1]);

const pointOutsideLogicalBounds = dst[0] < 0 || dst[0] > 1 || dst[1] < 0 || dst[1] > 1;
const pointInsideLogicalBounds = dst[0] >= 0 && dst[0] <= 1 && dst[1] >= 0 && dst[1] <= 1;

// Only apply mosaic and pixelate effects to points inside the "logical bounds".
if ((effects & ShaderManager.EFFECT_INFO.mosaic.mask) !== 0 && !pointOutsideLogicalBounds) {
if ((effects & ShaderManager.EFFECT_INFO.mosaic.mask) !== 0 && pointInsideLogicalBounds) {
// texcoord0 = fract(u_mosaic * texcoord0);
dst[0] = uniforms.u_mosaic * dst[0] % 1;
dst[1] = uniforms.u_mosaic * dst[1] % 1;
}
if ((effects & ShaderManager.EFFECT_INFO.pixelate.mask) !== 0 && !pointOutsideLogicalBounds) {
if ((effects & ShaderManager.EFFECT_INFO.pixelate.mask) !== 0 && pointInsideLogicalBounds) {
// vec2 pixelTexelSize = u_skinSize / u_pixelate;
const texelX = skinUniforms.u_skinSize[0] / uniforms.u_pixelate;
const texelY = skinUniforms.u_skinSize[1] / uniforms.u_pixelate;
Expand Down

0 comments on commit 8317671

Please sign in to comment.