public void mouseDragged(MouseEvent e) {
int x = (int)(e.getX()/scale);
int y = (int)(e.getY()/scale);
if( !selected.isInBounds(x,y) )
return;
int drawRadius = ((Number) spinnerRadius.getValue()).intValue();
ImageRectangle r = new ImageRectangle(x-drawRadius,y-drawRadius,x+drawRadius+1,y+drawRadius+1);
BoofMiscOps.boundRectangleInside(selected,r);
ImageMiscOps.fillRectangle(selected, (byte)1,r.x0,r.y0,r.x1-r.x0,r.y1-r.y0);
synchronized ( work ) {
int color = 0x22FF45;
for( int i = r.y0;i < r.y1; i++ ) {
for( int j = r.x0; j < r.x1; j++ ) {
work.setRGB(j,i,color);
}
}
}
repaint((int)(r.x0*scale),(int)(r.y0*scale),(int)((r.x1-r.x0)*scale),(int)((r.y1-r.y0)*scale));
}