Hi
I got to draw a big star map, with a lot jumps (lines). normally only a few of the jumps will be in view. So, I want to check if the line is inside the view before I draw it. But I can’t seem to get the code right.
So, how do I check it my line is inside the view or not?
It has to be drawn if any part of the line is inside view
public class GalaxyView extends JPanel{
private void paintJump(Graphics graphics, Point p1, Point p2) {
graphics.drawLine(p1.x, p1.y, p2.x, p2.y);
}
}
Hope I made sense…
/GoldenGnu