if (unLeft.width > 0) { drawHexes(unLeft); } else if (unRight.width > 0) { drawHexes(unRight); } if (unTop.height > 0) { drawHexes(unTop); } else if (unBottom.height > 0) { drawHexes(unBottom);
if(dirtyBoard) { drawHexes(view); dirtyBoard = false; } else {  if (unLeft.width > 0) { drawHexes(unLeft); } else if (unRight.width > 0) { drawHexes(unRight); } if (unTop.height > 0) { drawHexes(unTop); } else if (unBottom.height > 0) { drawHexes(unBottom); }
    private void moveBoardImage() {        // salvage the old        boardGraph.setClip(0, 0, boardRect.width, boardRect.height);        boardGraph.copyArea(0, 0, boardRect.width, boardRect.height,                boardRect.x - view.x, boardRect.y - view.y);        // what's left to paint?        int midX = Math.max(view.x, boardRect.x);        int midWidth = view.width - Math.abs(view.x - boardRect.x);        Rectangle unLeft = new Rectangle(view.x, view.y, boardRect.x - view.x, view.height);        Rectangle unRight = new Rectangle(boardRect.x + boardRect.width, view.y, view.x - boardRect.x, view.height);        Rectangle unTop = new Rectangle(midX, view.y, midWidth, boardRect.y - view.y);        Rectangle unBottom = new Rectangle(midX, boardRect.y + boardRect.height, midWidth, view.y - boardRect.y);        // update boardRect        boardRect = new Rectangle(view);        // paint needed areas        if (unLeft.width > 0) {            drawHexes(unLeft);        } else if (unRight.width > 0) {            drawHexes(unRight);        }        if (unTop.height > 0) {            drawHexes(unTop);        } else if (unBottom.height > 0) {            drawHexes(unBottom);        }    }