We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Lines draw incorrectly in PGraphics
Page Index Toggle Pages: 1
Lines draw incorrectly in PGraphics? (Read 2214 times)
Lines draw incorrectly in PGraphics?
May 31st, 2010, 8:28pm
 
When I run the code below I get differently capped lines, although it seems they should be the same:

Quote:
PGraphics pg;
int res = 600;
void setup ()
{
  size(res,res);
  pg = createGraphics(res,res,P2D);
}
void draw()
{
  strokeWeight(50);
  stroke(0);
  strokeCap(ROUND);
  line(400,200,200,400);
  pg.beginDraw();
  pg.strokeWeight(50);
  pg.stroke(100);
  pg.strokeCap(ROUND);
  pg.line(200,200,400,400);
  image(pg,0,0);
  pg.endDraw();
}



Is this a known issue?

thanks,

colin
Re: Lines draw incorrectly in PGraphics?
Reply #1 - Jun 1st, 2010, 1:03am
 
This Topic was moved here from Software Bugs by PhiLho .
Please, read the stickies at the top of each forum section!
Don't post in the Software Bugs section, even less if you are not sure that's a bug in Processing itself.
Re: Lines draw incorrectly in PGraphics?
Reply #2 - Jun 1st, 2010, 1:08am
 
I would invert the last two lines, even if it doesn't change anything...
And note that you compare two different drawing modes: default (JAVA2D) and P3D!
Now, if you take time to read the reference page of strokeCap(), you would see: Quote:
This function is not available with the P2D, P3D, or OPENGL renderers

So, to answer your question, it is a known limitation... Smiley
Re: Lines draw incorrectly in PGraphics?
Reply #3 - Jun 1st, 2010, 8:45am
 
Whoops!

Thanks. Sorry for the spam.
Page Index Toggle Pages: 1