*/
private void drawSelectionRect(Graphics g) {
if (!mouseInsideWindow) {
return;
}
ChunkView cv = view;
ChunkPosition cp = end;
g.setFont(font);
g.setColor(Color.red);
if (selectRect) {
ChunkPosition cp0 = start;
ChunkPosition cp1 = end;
int x0 = Math.min(cp0.x, cp1.x);
int x1 = Math.max(cp0.x, cp1.x);
int z0 = Math.min(cp0.z, cp1.z);
int z1 = Math.max(cp0.z, cp1.z);
x0 = (int) (cv.scale * (x0 - cv.x0));
z0 = (int) (cv.scale * (z0 - cv.z0));
x1 = (int) (cv.scale * (x1 - cv.x0 + 1));
z1 = (int) (cv.scale * (z1 - cv.z0 + 1));
g.setColor(Color.red);
g.drawRect(x0, z0, x1-x0, z1-z0);
} else {
// test if hovered chunk is visible
if (cv.isChunkVisible(cp)) {
if (cv.scale >= 16) {
int x0 = (int) (cv.scale * (cp.x - cv.x0));
int y0 = (int) (cv.scale * (cp.z - cv.z0));
int blockScale = cv.scale;