g.drawRect(0, 0, getZoomedXY(drawingWidth) - 1, getZoomedXY(drawingHeight) - 1);
g.drawRect(0, 0, getZoomedXY(drawingWidth), getZoomedXY(drawingHeight));
    public void paint(Graphics g)    {        if (this.isEnabled())        {            if (img == null) { return; }            if (this.drawingWidth * this.drawingHeight < 500)            {                for (int x = 0; x < this.drawingWidth; x++)                {                    for (int y = 0; y < this.drawingHeight; y++)                    {                        drawPoint(x, y, g);                    }                }            }            else            {                g.drawImage(img, 0, 0, getZoomedXY(drawingWidth),                    getZoomedXY(drawingHeight),                     //Color.BLACK,                    this);            }            //selection image            if (selection.width > 0 && selection.height > 0)            {                flattenSelection(g, true);                //			g.drawImage(                //				selectImg,                //				getZoomedXY(selection.x),                //				getZoomedXY(selection.y),                //				getZoomedXY(selection.width),                //				getZoomedXY(selection.height),                //				this);                //			g.setColor(Color.WHITE);                //			g.drawRect(                //				getZoomedXY(selection.x),                //				getZoomedXY(selection.y),                //				getZoomedXY(selection.width),                //				getZoomedXY(selection.height));            }            //gridlines            if (this.isDrawGridlines())            {                g.setColor(Color.BLACK);                for (int x = 0; x < this.drawingWidth; x++)                {                    g.drawLine(getZoomedXY(x), 0, getZoomedXY(x),                        getZoomedXY(this.drawingHeight) - 1);                }                for (int y = 0; y < this.drawingHeight; y++)                {                    g.drawLine(0, getZoomedXY(y),                        getZoomedXY(this.drawingWidth) - 1, getZoomedXY(y));                }                g.drawRect(0, 0, getZoomedXY(drawingWidth) - 1,                    getZoomedXY(drawingHeight) - 1);            }            //selection border            if (selection.width > 0 && selection.height > 0)            {                //			flattenSelection(g, true);                //			g.drawImage(                //				selectImg,                //				getZoomedXY(selection.x),                //				getZoomedXY(selection.y),                //				getZoomedXY(selection.width),                //				getZoomedXY(selection.height),                //				this);                g.setColor(Color.WHITE);                g                    .drawRect(getZoomedXY(selection.x),                        getZoomedXY(selection.y), getZoomedXY(selection.width),                        getZoomedXY(selection.height));            }        }        else        {            g.setColor(Color.GRAY);            g.fillRect(0, 0, this.getWidth(), this.getHeight());            g.setColor(Color.RED);            g.drawLine(0, 0, this.getWidth(), this.getHeight());            g.drawLine(this.getWidth(), 0, 0, this.getHeight());        }    }