Back to all rules
What this rule checks
Uses pushMatrix()/popMatrix() for coordinate transformations
Configuration
When off, this rule is excluded from pipeline runs. Changes apply immediately.
Code Examples
PASS — this code satisfies the rule
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  rect(mouseX - 25, mouseY - 25, 50, 50);  // position worked out directly
  rect(mouseX + 35, mouseY - 25, 50, 50);
}
FAIL — this code triggers the rule
void setup() {
  size(400, 400);
}

void draw() {
  background(255);
  pushMatrix();
  translate(mouseX, mouseY);
  rect(-25, -25, 50, 50);
  rect(35, -25, 50, 50);
  popMatrix();
}
Overview
Category Out of Scope
Type Custom Zita
Priority 3 (1 = highest, 5 = lowest)
Status Active
PMD Configuration
Java class nl.utwente.processing.pmd.rules.HasPushPopMatrixRule
Message template pushMatrix()/popMatrix() usage found.