PShape.scale() affects strokeWeight differently in P2D and P3D #4231

Closed
maxdee opened this Issue Jan 13, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@maxdee

maxdee commented Jan 13, 2016

When using PShape.scale() in P2D, the strokeWeight is also scaled, with P3D the strokeWeight does not change.

// testing strokeWeight for PShape.scale() in P2D vs P3D

PShape shp;

void setup(){
  // P2D scales the strokeWeight, P3D does not.
  size(400,400,P3D);//P2D); 
  shp = createShape();
  shp.beginShape();
  shp.noFill();
  shp.stroke(255);
  shp.strokeWeight(10);
  for(int i = 0; i < 10; i++){
    shp.vertex(random(400),random(400));
  }
  shp.endShape();
}

void draw(){
  background(0);
  float scaler = (float(millis()%2000)/2000)+0.00001;
  shp.scale(scaler); // scale
  shape(shp, 0,0);
  shp.scale(1.0/scaler); // unscale
}

@codeanticode codeanticode added the opengl label Jan 14, 2016

@codeanticode codeanticode self-assigned this Jan 14, 2016

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Jan 14, 2016

Member

Nice one, thanks for the report! Taken care with a20de58, fix will be available in next release of Processing.

Member

codeanticode commented Jan 14, 2016

Nice one, thanks for the report! Taken care with a20de58, fix will be available in next release of Processing.

@maxdee

This comment has been minimized.

Show comment
Hide comment
@maxdee

maxdee Jan 15, 2016

Awesome!
Y'all rock.

maxdee commented Jan 15, 2016

Awesome!
Y'all rock.

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