protected void generateBrushCursorScaled(float scale) {
    BufferedImage outlineSource = brush.getScaledImage();
    int w = (int) Math.max(scale * outlineSource.getWidth(), 1);
    int h = (int) Math.max(scale * outlineSource.getHeight(), 1);
    BufferedImage outlineSourceScaled = new BufferedImage(w, h, outlineSource.getType());

    Graphics2D g = (Graphics2D) outlineSourceScaled.getGraphics();
    g.drawImage(outlineSource, 0, 0, w, h, null);
    g.dispose();
    lastScale = scale;
    brushCursorScaled = OutlineUtil.generateOutline(outlineSourceScaled, Color.BLACK, true);
  }
 protected void generateBrushCursor() {
   brushCursorOriginal = OutlineUtil.generateOutline(brush.getScaledImage(), Color.BLACK, false);
   generateBrushCursorScaled(lastScale);
 }