Skip to content

Commit

Permalink
fixes cell drawing for #57
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderPico committed Nov 6, 2017
1 parent 6defbfc commit 2dfb497
Showing 1 changed file with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,26 +579,14 @@ static private GeneralPath makeNucleus() {

static private GeneralPath makeCell()
{
double width = 100.0;
double height = 80.0;
double halfgap = 1.0; // e.g., 1.0 is half of a 2.0 symmetrically-scaling gap
double width = 100.0 + halfgap;
double height = 80.0 + halfgap;
double x = 0.0;
double y = 0.0;
double curveRad = 8.0;
double gap = 2.0;
// Shape rrect = new RoundRectangle2D.Double(x,y, width, height, curveRad, curveRad);
// x += gap;
// y += gap;
// gap *= 2;
// width -= gap;
// height -= gap;
// Shape innerrrect = new RoundRectangle2D.Double(x,y, width, height, curveRad, curveRad);
// PathIterator iter = rrect.getPathIterator(new AffineTransform());
// for (; !iter.isDone(); iter.next()) {
// outPath.append(iter.next())}
// }
double curveRad = 2.0;

GeneralPath path = new GeneralPath();
// path.moveTo(-100, -100);
GeneralPath path = new GeneralPath();
path.moveTo(x, curveRad);
path.curveTo(x, y, curveRad, y, x+curveRad, y);
path.lineTo(width - curveRad, y);
Expand All @@ -609,10 +597,10 @@ static private GeneralPath makeCell()
path.curveTo(x, height, x, height - curveRad, x, height - curveRad);
path.lineTo(x, curveRad);

width -= 2 * gap;
height -= 2 * gap;
x += gap;
y += gap;
width -= halfgap;
height -= halfgap;
x += halfgap;
y += halfgap;
path.moveTo(x, curveRad);
path.curveTo(x, y, curveRad, y, x+curveRad, y);
path.lineTo(width - curveRad, y);
Expand Down

0 comments on commit 2dfb497

Please sign in to comment.