Skip to content

Commit 8f0c3ca

Browse files
committed
Fix rect 4-radius: remove misplaced implementation from top of file
1 parent 7b0c010 commit 8f0c3ca

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

src/Processing.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
#
2-
void PApplet::rect(float x,float y,float w,float h,float tl,float tr,float br,float bl){
3-
// Draw rect with 4 different corner radii
4-
if(!doFill && !doStroke) return;
5-
float x2=x+w, y2=y+h;
6-
beginShape();
7-
vertex(x+tl,y); vertex(x2-tr,y); // top
8-
if(tr>0){for(int i=0;i<=8;i++){float a=PI+HALF_PI+HALF_PI*i/8.f;vertex(x2-tr+::std::cos(a)*tr,y+tr+::std::sin(a)*tr);}}
9-
vertex(x2,y+tr); vertex(x2,y2-br); // right
10-
if(br>0){for(int i=0;i<=8;i++){float a=0+HALF_PI*i/8.f;vertex(x2-br+::std::cos(a)*br,y2-br+::std::sin(a)*br);}}
11-
vertex(x2-br,y2); vertex(x+bl,y2); // bottom
12-
if(bl>0){for(int i=0;i<=8;i++){float a=HALF_PI+HALF_PI*i/8.f;vertex(x+bl+::std::cos(a)*bl,y2-bl+::std::sin(a)*bl);}}
13-
vertex(x,y2-bl); vertex(x,y+tl); // left
14-
if(tl>0){for(int i=0;i<=8;i++){float a=PI+HALF_PI*i/8.f;vertex(x+tl+::std::cos(a)*tl,y+tl+::std::sin(a)*tl);}}
15-
endShape(CLOSE);
16-
}
172
if __has_include("stb_truetype.h")
183
# define PROCESSING_HAS_STB_TRUETYPE 1
194
# define STB_TRUETYPE_IMPLEMENTATION

0 commit comments

Comments
 (0)