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++)                {                    if (selection.width > 0                        && selection.height > 0                        && selection.contains(x, y))                    {                        g.setColor(                            pal.getColorOf(                                selectImg[x - selection.x][y - selection.y]));                        g.fillRect(                            (int) (x * zoom),                            (int) (y * zoom),                            (int) zoom,                            (int) zoom);                    }                    else                    {                        drawPoint(x, y, g);                    }                }            }            //}            /*             * else { g .drawImage( this.getImage(), 0, 0,             * getZoomedXY(drawingWidth), getZoomedXY(drawingHeight),             * //Color.BLACK, this);             */            //selection image            //		if (selection.width > 0 && selection.height > 0)            //		{            //			flattenSelection(g, true);            //		}            //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());        }    }