diff --git a/src/main/java/de/neemann/digital/draw/graphics/Vector.java b/src/main/java/de/neemann/digital/draw/graphics/Vector.java index 5b0547c47..923df72c5 100644 --- a/src/main/java/de/neemann/digital/draw/graphics/Vector.java +++ b/src/main/java/de/neemann/digital/draw/graphics/Vector.java @@ -112,6 +112,20 @@ public class Vector { return new Vector(this.x + x, this.y + y); } + /** + * Adds a offset to every vector in the given list + * + * @param vectors the original vectors + * @param offs the offset + * @return the new list + */ + public static List add(List vectors, Vector offs) { + ArrayList newVec = new ArrayList<>(); + for (Vector v : vectors) + newVec.add(v.add(offs)); + return newVec; + } + /** * Creates a new vector which has the value this-a * @@ -195,17 +209,4 @@ public class Vector { return new Vector(Math.round(x * 128 / l), Math.round(y * 128 / l)); } - /** - * Adds a offset to every vector in the given list - * - * @param vectors the original vectors - * @param offs the offset - * @return the new list - */ - public static List add(List vectors, Vector offs) { - ArrayList newVec = new ArrayList<>(); - for (Vector v : vectors) - newVec.add(v.add(offs)); - return newVec; - } }