setFill on PShape throws ArrayIndexOutOfBoundsException #3677

Closed
clankill3r opened this Issue Aug 20, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@clankill3r

processing 3.b4
http://forum.processing.org/two/discussion/12169/pshape-setfill-causing-arrayindexoutofboundsexception

ArrayIndexOutOfBoundsException: 6
(caused by last line of code)

PShape triShape;
int triWidth = 24;
int triHeight = 12;
PVector size = new PVector(triWidth, triHeight);

void setup()
{
  size(200, 200);

  triShape = createShape();
  triShape.beginShape();      
  triShape.vertex(0, 0);
  triShape.vertex(size.x, 0);
  triShape.vertex(size.x / 2, size.y);    
  triShape.endShape(CLOSE);
}

void draw()
{
  shape(triShape, 20, 20);
  triShape.setFill(color(255, 0, 0));
}

Setting the size to P2D fixes the problem.

@benfry benfry closed this in 7713c08 Aug 21, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Aug 21, 2015

Member

Fixed for 3.0 beta 5, thanks for reporting.

Member

benfry commented Aug 21, 2015

Fixed for 3.0 beta 5, thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment