Area background = new Area(area);
Area cornerRegion = new Area();
Area[] cornerBorder = new Area[]{new Area(), new Area(), new Area(), new Area()};
-
+ Area[] clip = new Area[4];
if (roundCorner[TOP_LEFT]) {
AffineTransform transform = new AffineTransform();
int beforeRadius = (int)(cornerCorrectionFactor * bpsBefore.getRadiusStart());
background.subtract(makeCornerClip(beforeRadius, startRadius,
transform));
- Area clip = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
- clip.transform(transform);
- cornerRegion.add(clip);
+ clip[TOP_LEFT] = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
+ clip[TOP_LEFT].transform(transform);
+ cornerRegion.add(clip[TOP_LEFT]);
cornerBorder[TOP].add(makeCornerBorderBPD(beforeRadius,
startRadius, beforeWidth, startWidth, transform));
background.subtract(makeCornerClip(beforeRadius, startRadius,
transform));
- Area clip = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
- clip.transform(transform);
- cornerRegion.add(clip);
+ clip[TOP_RIGHT] = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
+ clip[TOP_RIGHT].transform(transform);
+ cornerRegion.add(clip[TOP_RIGHT]);
cornerBorder[TOP].add(makeCornerBorderBPD(beforeRadius,
startRadius, beforeWidth, startWidth, transform));
background.subtract(makeCornerClip(beforeRadius, startRadius,
transform));
- Area clip = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
- clip.transform(transform);
- cornerRegion.add(clip);
+ clip[BOTTOM_RIGHT] = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
+ clip[BOTTOM_RIGHT].transform(transform);
+ cornerRegion.add(clip[BOTTOM_RIGHT]);
cornerBorder[BOTTOM].add(makeCornerBorderBPD(beforeRadius,
startRadius, beforeWidth, startWidth, transform));
background.subtract(makeCornerClip(beforeRadius, startRadius,
transform));
- Area clip = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
- clip.transform(transform);
- cornerRegion.add(clip);
+ clip[BOTTOM_LEFT] = new Area(new Rectangle(0, 0, startRadius, beforeRadius));
+ clip[BOTTOM_LEFT].transform(transform);
+ cornerRegion.add(clip[BOTTOM_LEFT]);
cornerBorder[BOTTOM].add(makeCornerBorderBPD(beforeRadius,
startRadius, beforeWidth, startWidth, transform));
Area border = new Area(borderPath);
- border.subtract(cornerRegion);
+ if (clip[TOP_LEFT] != null) {
+ border.subtract(clip[TOP_LEFT]);
+ }
+ if (clip[TOP_RIGHT] != null) {
+ border.subtract(clip[TOP_RIGHT]);
+ }
g2d.setColor(bpsBefore.color);
g2d.fill(border);
Area border = new Area(borderPath);
- border.subtract(cornerRegion);
+ if (clip[BOTTOM_RIGHT] != null) {
+ border.subtract(clip[BOTTOM_RIGHT]);
+ }
+ if (clip[TOP_RIGHT] != null) {
+ border.subtract(clip[TOP_RIGHT]);
+ }
g2d.setColor(bpsEnd.color);
g2d.fill(border);
borderPath.lineTo(bpsStart == null ? 0 : bpsStart.width,
borderRect.height - bpsAfter.width);
Area border = new Area(borderPath);
-
- border.subtract(cornerRegion);
-
+ if (clip[BOTTOM_LEFT] != null) {
+ border.subtract(clip[BOTTOM_LEFT]);
+ }
+ if (clip[BOTTOM_RIGHT] != null) {
+ border.subtract(clip[BOTTOM_RIGHT]);
+ }
g2d.setColor(bpsAfter.color);
g2d.fill(border);
g2d.fill(cornerBorder[BOTTOM]);
Area border = new Area(borderPath);
- border.subtract(cornerRegion);
-
+ if (clip[BOTTOM_LEFT] != null) {
+ border.subtract(clip[BOTTOM_LEFT]);
+ }
+ if (clip[TOP_LEFT] != null) {
+ border.subtract(clip[TOP_LEFT]);
+ }
g2d.setColor(bpsStart.color);
g2d.fill(border);
g2d.fill(cornerBorder[LEFT]);