FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Software Bugs
(Moderator: fry)
   ellipse cut_off repost
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: ellipse cut_off repost  (Read 782 times)
fjen

WWW
ellipse cut_off repost
« on: Sep 28th, 2004, 7:17pm »

i repost here .. think it's a bug and maybe should be moved here:
 
http://processing.org/discourse/yabb/board_Syntax_action_displa_y_num_1095778415.html
 
problem:
ellipse(0,0,100,100) is 1px larger than rect(0,0,100,100)
while
ellipse(0,0,99,99) is same size as rect(0,0,99,99)
 
example:
http://www.florianjenett.de/p55/ellipse_bug/applet.html
 
bug in ellipse(x,y,w,h) or do i just not see the problem
/F
 
fjen

WWW
Re: ellipse cut_off repost
« Reply #1 on: Sep 28th, 2004, 7:19pm »

better example ... switch wh underneath setup and move mouse over the right or lower edge of the rect/ellipse ...
 
Code:

void setup() {size(200,200);}
 
// 99 is 1px too small
// int wh = 99;
 
// 100 is ok
int wh = 100;
 
void loop() {
  //
  noStroke();
  // bounding box for ellipseMode(CORNER)
  rect(0,0,wh,wh);
  noFill();
  stroke(1);
  ellipseMode(CORNER);
  ellipse(0,0,wh,wh);
  //
  // this is just the zoom ...
  int zoomX = mouseX;//wh;
  int zoomY = mouseY;//wh/2;
  rect(124,124,51,51);
  if (zoomX > 5 & zoomX < width-5 & zoomY > 5 & zoomY < height-5){
    int[] zPxls = new int[100];
    for (int i=0; i<100; i++) zPxls[i] = pixels[((zoomY-5)+ int(i/10))*width + (zoomX-5) + (i % 10)];
    BImage bimg = new BImage(zPxls, 10, 10, RGBA);
    image(bimg, 125,125,50,50);
  }
}
 
Pages: 1 

« Previous topic | Next topic »