diff --git a/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeCursor.java b/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeCursor.java index c26af1d1..dbaf03be 100644 --- a/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeCursor.java +++ b/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeCursor.java @@ -65,7 +65,7 @@ public IterationCodeCursor( final TIntArrayList itcode, final long[] offset ) protected IterationCodeCursor( final IterationCodeCursor c ) { - super( c.position ); + super( c.position.clone() ); iter = new IterationCodeIterator<>( c.iter, Point.wrap( position ) ); } diff --git a/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeListCursor.java b/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeListCursor.java index 178c35f2..972f2c4a 100644 --- a/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeListCursor.java +++ b/src/main/java/net/imglib2/roi/util/iterationcode/IterationCodeListCursor.java @@ -65,7 +65,7 @@ public IterationCodeListCursor( final ArrayList< TIntArrayList > itcodesList, fi protected IterationCodeListCursor( final IterationCodeListCursor c ) { - super( c.position ); + super( c.position.clone() ); iter = new IterationCodeListIterator<>( c.iter, Point.wrap( position ) ); }