Skip to content

Commit

Permalink
Merge pull request #123 from CartoDB/fix-and-expression
Browse files Browse the repository at this point in the history
Fix "AND" expression
  • Loading branch information
IagoLast authored Mar 1, 2018
2 parents 31a16fd + b791bb9 commit b0f5d63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/style/expressions/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const LessThanOrEqualTo = genBinaryOp((x, y) => x <= y ? 1 : 0, (x, y) =>
export const Equals = genBinaryOp((x, y) => x == y ? 1 : 0, (x, y) => `(${x}==${y}? 1.:0.)`);
export const NotEquals = genBinaryOp((x, y) => x != y ? 1 : 0, (x, y) => `(${x}!=${y}? 1.:0.)`);

export const Or = genBinaryOp((x, y) => Math.min(x + y, 1), (x, y) => `min(${x} + ${y}, 1.)`);
export const And = genBinaryOp((x, y) => x * y, (x, y) => `(${x} * ${y})`);
export const Or = genBinaryOp((x, y) => Math.min(x + y, 1), (x, y) => `min(${x} + ${y}, 1.)`);
export const And = genBinaryOp((x, y) => Math.min(x * y, 1), (x, y) => `min(${x} * ${y}, 1.)`);

function genBinaryOp(jsFn, glsl) {
return class BinaryOperation extends Expression {
Expand Down

0 comments on commit b0f5d63

Please sign in to comment.