I'm trying to create a box with rounded corners using FLTK. I got the the box to print with the arcs in the right positions, but my math appears to be all wonky. When create a box with a width of 300, and height 200, the arcs float in space, instead of connecting to my line segments.
I'm taking 10% of the longer side, and subtracting it from each corner of the rectangle. e.g. if w>h then x axis for top left corner x = xy.x + (xy.x* 0.10) If the ratio of the h or w is too long, I can't even see the shorter sides.
Plus I thought that if I can take 10% from each corner, and I can make the arc foci 10% , and this would make up for that which was subtracted to create the shortened line segments.
double longer_side_tenth; //10% of the width that will calculate the length to remove from each side to make room for the arcs
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
Box::Box(Point xxyy, int ww, int hh): w(ww), h(hh), xy(xxyy)
{
double top_seg_begin_w; //where the line segment will begin after deducting 10% of w;
double top_seg_end_w; //where the line segment will end after deducting 10% of w;