Ignore:
Timestamp:
2010-06-21T19:57:58+02:00 (14 years ago)
Author:
upliner
Message:

buildings_tools: update cursor and fix NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/buildings_tools/src/buildings_tools/DrawBuildingAction.java

    r21846 r21869  
    340340                if (mousePos == null)
    341341                        return;
     342                if (!Main.isDisplayingMapView())
     343                        return;
    342344                Node n = null;
    343345                if (!isCtrlDown)
     
    412414                        return;
    413415                }
    414                 final int r = 11; // crosshair radius
     416                final int R = 9; // crosshair outer radius
     417                final int r = 3; // crosshair inner radius
    415418                BufferedImage img = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB);
    416419                Graphics2D g = img.createGraphics();
    417420
    418421                GeneralPath b = new GeneralPath();
    419                 b.moveTo(16 - Math.cos(angle) * r, 16 - Math.sin(angle) * r);
     422                b.moveTo(16 - Math.cos(angle) * R, 16 - Math.sin(angle) * R);
     423                b.lineTo(16 - Math.cos(angle) * r, 16 - Math.sin(angle) * r);
     424                b.moveTo(16 + Math.cos(angle) * R, 16 + Math.sin(angle) * R);
    420425                b.lineTo(16 + Math.cos(angle) * r, 16 + Math.sin(angle) * r);
    421                 b.moveTo(16 + Math.sin(angle) * r, 16 - Math.cos(angle) * r);
     426                b.moveTo(16 + Math.sin(angle) * R, 16 - Math.cos(angle) * R);
     427                b.lineTo(16 + Math.sin(angle) * r, 16 - Math.cos(angle) * r);
     428                b.moveTo(16 - Math.sin(angle) * R, 16 + Math.cos(angle) * R);
    422429                b.lineTo(16 - Math.sin(angle) * r, 16 + Math.cos(angle) * r);
    423430
Note: See TracChangeset for help on using the changeset viewer.