Loading...
Logo
Processing Forum
I noticed that right and left 45-degree diagonals drawn with line() have different widths.
To me these should be symmetrics but they don't appear so.
In some case the right diagonal is wider, in other case it is the left one, probably depending of the color.
I'm not sure if this is a Processing bug, or a display specific problem.
 
Try this program and tell me what you see.
 
Copy code
  1. void setup() {
      size(200,200);
      noLoop();
      //
      //
    }//setup()
  2. void draw() {
      stroke(color(50,100,255));
      strokeWeight(1);
      line(-30,0,170,200);//OK
      line(0,170,200,-30);//OK
      //
      stroke(color(50,100,255));
      strokeWeight(2);
      line(0,0,200,200);//wider
      line(0,200,200,0);//thinner
      //
      stroke(color(255,100,50));
      strokeWeight(4);
      line(30,0,230,200);//thinner
      line(0,230,200,30);//wider
      //
      stroke(color(50,100,255));
      strokeWeight(3);
      line(60,0,260,200);//wider
      line(0,260,200,60);//thinner
    }//draw()

Replies(1)

Mmm, yes, there is a little problem with JAVA2D (it doesn't appear in P2D mode). If you activate smooth(), the lines are more consistent.