Skip to content
Snippets Groups Projects
Commit 34c0bb46 authored by pleumann's avatar pleumann
Browse files

Avoid positioning of the minimap rectangle outside the available area....

Avoid positioning of the minimap rectangle outside the available area. Resulted in very strange artifacts on the screen.
parent 3b3c2ea3
No related branches found
No related tags found
No related merge requests found
...@@ -186,6 +186,19 @@ public class MiniMapView extends JComponent { ...@@ -186,6 +186,19 @@ public class MiniMapView extends JComponent {
Rectangle oldRectangle = getViewRectangle(); Rectangle oldRectangle = getViewRectangle();
upperLeft[0] = centerX - oldRectangle.width/2; upperLeft[0] = centerX - oldRectangle.width/2;
upperLeft[1] = centerY - oldRectangle.height/2; upperLeft[1] = centerY - oldRectangle.height/2;
/*
* JP, 25-May-03: Avoid positioning of the rectangle outside the
* available area. Resulted in very strange artifacts on the screen.
*/
if (upperLeft[0] + oldRectangle.width >= getX() + getWidth()) {
upperLeft[0] = getX() + getWidth() - oldRectangle.width - 1;
}
if (upperLeft[1] + oldRectangle.height >= getY() + getHeight()) {
upperLeft[1] = getY() + getHeight() - oldRectangle.height - 1;
}
return upperLeft; return upperLeft;
} }
......
...@@ -186,6 +186,19 @@ public class MiniMapView extends JComponent { ...@@ -186,6 +186,19 @@ public class MiniMapView extends JComponent {
Rectangle oldRectangle = getViewRectangle(); Rectangle oldRectangle = getViewRectangle();
upperLeft[0] = centerX - oldRectangle.width/2; upperLeft[0] = centerX - oldRectangle.width/2;
upperLeft[1] = centerY - oldRectangle.height/2; upperLeft[1] = centerY - oldRectangle.height/2;
/*
* JP, 25-May-03: Avoid positioning of the rectangle outside the
* available area. Resulted in very strange artifacts on the screen.
*/
if (upperLeft[0] + oldRectangle.width >= getX() + getWidth()) {
upperLeft[0] = getX() + getWidth() - oldRectangle.width - 1;
}
if (upperLeft[1] + oldRectangle.height >= getY() + getHeight()) {
upperLeft[1] = getY() + getHeight() - oldRectangle.height - 1;
}
return upperLeft; return upperLeft;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment