Ignore:
Timestamp:
2016-08-07T22:52:29+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13290 - pasting from other layer changes objects position (modified patch by michael2402) - gsoc-core

Location:
trunk/src/org/openstreetmap/josm/gui/datatransfer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java

    r10737 r10766  
    8383     * Paste the current clipboard current at the given position
    8484     * @param editLayer The layer to paste on.
    85      * @param mPosition The position to paste at.
     85     * @param mPosition The position to paste at. If it is <code>null</code>, the original position will be used.
    8686     */
    8787    public void pasteOn(OsmDataLayer editLayer, EastNorth mPosition) {
     
    9393     * Paste the given clipboard current at the given position
    9494     * @param editLayer The layer to paste on.
    95      * @param mPosition The position to paste at.
     95     * @param mPosition The position to paste at. If it is <code>null</code>, the original position will be used.
    9696     * @param transferable The transferable to use.
    9797     */
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java

    r10604 r10766  
    5050
    5151        EastNorth center = pasteBuffer.getCenter();
    52         EastNorth offset = center == null ? null : pasteAt.subtract(center);
     52        EastNorth offset = center == null || pasteAt == null ? new EastNorth(0, 0) : pasteAt.subtract(center);
    5353
    5454        AddPrimitivesCommand command = createNewPrimitives(pasteBuffer, offset, layer);
Note: See TracChangeset for help on using the changeset viewer.