Say I drew two circles 30 pixels radius and 20 pixels apart. You’d get a cross-over of lines. How can I prevent this crossover?
I’ve tried looking at various graphics filtering but I haven’t found anything suitable.
(This question is not limited to 2 circles)
You can use
java.awt.geom.Areaclass to do the operations. It hasadd(), intersect(), subtract() methods.
Create one Area (sum of both ovals) and subtract another Area (intersection of both ovals).
Working code: