private void normalizeCenter() {
        int halfWidth = viewportWidth/2;
        int halfHeight = viewportHeight/2;
        int imageWidth = (int) this.getImage().getWidth();
        int imageHeight = (int) this.getImage().getHeight();
        if((center.x-halfWidth)<0) {
            center.x = halfWidth;
        } else if((center.x+halfWidth)>imageWidth) {
            center.x = imageWidth-halfWidth;
        }
        if((center.y-halfHeight)<0) {
            center.y = halfHeight;
        } else if((center.y+halfHeight)>imageHeight) {
            center.y = imageHeight-halfHeight;
        }
    }