benfry / processing4

Processing 4.x releases for Java 17
https://processing.org
Other
1.31k stars 236 forks source link

code symmetry typo or bug in public void setTint(int fill) calls setFill(i,fill) in PShape.java ? #820

Open cubr3 opened 5 months ago

cubr3 commented 5 months ago

Hi,

1) sorry if it's not a bug but setFill and setTint in PShape.java seems to code the same behavior for two different attributes but... setTint(int fill) :

public void setTint(int fill) { if (openShape) { PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()"); return; }

tintColor = fill;

if (vertices != null) {
  for  (int i = 0; i < vertices.length; i++) {
    setFill(i, fill);       <--------------------------- here: shouldn't be setTint(i,fill) ?
  }
}

}

2) a warning message typo in public void setFill(int index, int fill) : line 2631: PGraphics.showWarning(NO_SUCH_VERTEX_ERROR + " (" + index + ")", "getFill()"); "getFill()" rather than "setFill()" in warning message ?