Repository: KLayout/klayout (language: python)

Issue:
Add `(D)Point.move(d)`
Hi Matthias,

I noticed basically all shape-like objects except the point ones have a `move(d)` function. Would it be possible to add this for Point as well?

Also, one additional question, but maybe that's not possible due to footprint matching. Would it be possible to add 0 as a default value for `dx`/`dy`? Rational being then (in python at least), you can do `point.move(dy=500)` without needing to specify `dx` and the other way around. This would be purely convenience, so if not easily achievable, that's totally okay!


Discussion / hints:

Fix patch:
diff --git a/src/db/db/gsiDeclDbBox.cc b/src/db/db/gsiDeclDbBox.cc
index d2c5fcc8f..6bf0601da 100644
--- a/src/db/db/gsiDeclDbBox.cc
+++ b/src/db/db/gsiDeclDbBox.cc
@@ -380,36 +380,34 @@ struct box_defs
       "\n"
       "@return The scaled box\n"
     ) +
-    method_ext ("move", &box_defs<C>::move, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("move", &box_defs<C>::move, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Moves the box by a certain distance\n"
       "\n"
-      "\n"
       "This is a convenience method which takes two values instead of a Point object.\n"
       "This method has been introduced in version 0.23.\n"
       "\n"
       "@return A reference to this box.\n"
     ) +
-    method_ext ("moved", &box_defs<C>::moved, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("moved", &box_defs<C>::moved, gsi::arg ("dx, 0"), gsi::arg ("dy", 0),
       "@brief Moves the box by a certain distance\n"
       "\n"
-      "\n"
       "This is a convenience method which takes two values instead of a Point object.\n"
       "This method has been introduced in version 0.23.\n"
       "\n"
       "@return The moved box.\n"
     ) +
-    method ("move", &C::move, gsi::arg ("distance"),
+    method ("move", &C::move, gsi::arg ("d"),
       "@brief Moves the box by a certain distance\n"
       "\n"
       "\n"
       "Moves the box by a given offset and returns the moved\n"
       "box. Does not check for coordinate overflows.\n"
       "\n"
-      "@param distance The offset to move the box.\n"
+      "@param d The offset to move the box.\n"
       "\n"
       "@return A reference to this box.\n"
     ) +
-    method ("moved", &C::moved, gsi::arg ("distance"),
+    method ("moved", &C::moved, gsi::arg ("d"),
       "@brief Returns the box moved by a certain distance\n"
       "\n"
       "\n"
@@ -417,7 +415,7 @@ struct box_defs
       "box. Does not modify this box. Does not check for coordinate\n"
       "overflows.\n"
       "\n"
-      "@param distance The offset to move the box.\n"
+      "@param d The offset to move the box.\n"
       "\n"
       "@return The moved box.\n"
     ) +
diff --git a/src/db/db/gsiDeclDbEdge.cc b/src/db/db/gsiDeclDbEdge.cc
index 1abff3145..c50c89c18 100644
--- a/src/db/db/gsiDeclDbEdge.cc
+++ b/src/db/db/gsiDeclDbEdge.cc
@@ -207,17 +207,17 @@ struct edge_defs
       "\n"
       "This method has been introduced in version 0.25.\n"
     ) +
-    method ("moved", &C::moved, gsi::arg ("p"),
+    method ("moved", &C::moved, gsi::arg ("v"),
       "@brief Returns the moved edge (does not modify self)\n"
       "\n"
       "Moves the edge by the given offset and returns the \n"
       "moved edge. The edge is not modified.\n"
       "\n"
-      "@param p The distance to move the edge.\n"
+      "@param v The distance to move the edge.\n"
       "\n"
       "@return The moved edge.\n"
     ) +
-    method_ext ("moved", &moved_xy, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Returns the moved edge (does not modify self)\n"
       "\n"
       "Moves the edge by the given offset and returns the \n"
@@ -325,17 +325,17 @@ struct edge_defs
       "\n"
       "@return The transformed edge.\n"
     ) +
-    method ("move", &C::move, gsi::arg ("p"),
+    method ("move", &C::move, gsi::arg ("v"),
       "@brief Moves the edge.\n"
       "\n"
       "Moves the edge by the given offset and returns the \n"
       "moved edge. The edge is overwritten.\n"
       "\n"
-      "@param p The distance to move the edge.\n"
+      "@param v The distance to move the edge.\n"
       "\n"
       "@return The moved edge.\n"
     ) +
-    method_ext ("move", &move_xy, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Moves the edge.\n"
       "\n"
       "Moves the edge by the given offset and returns the \n"
diff --git a/src/db/db/gsiDeclDbEdgePairs.cc b/src/db/db/gsiDeclDbEdgePairs.cc
index 780b95442..3fa1633f0 100644
--- a/src/db/db/gsiDeclDbEdgePairs.cc
+++ b/src/db/db/gsiDeclDbEdgePairs.cc
@@ -735,49 +735,49 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
     "\n"
     "The 'join_with' alias has been introduced in version 0.28.12."
   ) +
-  method_ext ("move", &move_p, gsi::arg ("p"),
+  method_ext ("move", &move_p, gsi::arg ("v"),
     "@brief Moves the edge pair collection\n"
     "\n"
     "Moves the edge pairs by the given offset and returns the \n"
     "moved edge pair collection. The edge pair collection is overwritten.\n"
     "\n"
-    "@param p The distance to move the edge pairs.\n"
+    "@param v The distance to move the edge pairs.\n"
     "\n"
     "@return The moved edge pairs (self).\n"
     "\n"
     "Starting with version 0.25 the displacement is of vector type."
   ) +
-  method_ext ("move", &move_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("move", &move_xy, gsi::arg ("dx"), gsi::arg ("dy"),
     "@brief Moves the edge pair collection\n"
     "\n"
     "Moves the edge pairs by the given offset and returns the \n"
     "moved edge pairs. The edge pair collection is overwritten.\n"
     "\n"
-    "@param x The x distance to move the edge pairs.\n"
-    "@param y The y distance to move the edge pairs.\n"
+    "@param dx The x distance to move the edge pairs.\n"
+    "@param dy The y distance to move the edge pairs.\n"
     "\n"
     "@return The moved edge pairs (self).\n"
   ) +
-  method_ext ("moved", &moved_p, gsi::arg ("p"),
+  method_ext ("moved", &moved_p, gsi::arg ("v"),
     "@brief Returns the moved edge pair collection (does not modify self)\n"
     "\n"
     "Moves the edge pairs by the given offset and returns the \n"
     "moved edge pairs. The edge pair collection is not modified.\n"
     "\n"
-    "@param p The distance to move the edge pairs.\n"
+    "@param v The distance to move the edge pairs.\n"
     "\n"
     "@return The moved edge pairs.\n"
     "\n"
     "Starting with version 0.25 the displacement is of vector type."
   ) +
-  method_ext ("moved", &moved_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
     "@brief Returns the moved edge pair collection (does not modify self)\n"
     "\n"
     "Moves the edge pairs by the given offset and returns the \n"
     "moved edge pairs. The edge pair collection is not modified.\n"
     "\n"
-    "@param x The x distance to move the edge pairs.\n"
-    "@param y The y distance to move the edge pairs.\n"
+    "@param dx The x distance to move the edge pairs.\n"
+    "@param dy The y distance to move the edge pairs.\n"
     "\n"
     "@return The moved edge pairs.\n"
   ) +
diff --git a/src/db/db/gsiDeclDbEdges.cc b/src/db/db/gsiDeclDbEdges.cc
index 6d86681e5..78776b43f 100644
--- a/src/db/db/gsiDeclDbEdges.cc
+++ b/src/db/db/gsiDeclDbEdges.cc
@@ -1621,14 +1621,14 @@ Class<db::Edges> decl_Edges (decl_dbShapeCollection, "db", "Edges",
     "\n"
     "Starting with version 0.25 the displacement type is a vector."
   ) +
-  method_ext ("move", &move_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
     "@brief Moves the edge collection\n"
     "\n"
     "Moves the edge collection by the given offset and returns the \n"
     "moved edge collection. The edge collection is overwritten.\n"
     "\n"
-    "@param x The x distance to move the edge collection.\n"
-    "@param y The y distance to move the edge collection.\n"
+    "@param dx The x distance to move the edge collection.\n"
+    "@param dy The y distance to move the edge collection.\n"
     "\n"
     "@return The moved edge collection (self).\n"
   ) +
@@ -1644,14 +1644,14 @@ Class<db::Edges> decl_Edges (decl_dbShapeCollection, "db", "Edges",
     "\n"
     "Starting with version 0.25 the displacement type is a vector."
   ) +
-  method_ext ("moved", &moved_xy, gsi::arg ("x"), gsi::arg ("v"),
+  method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dv", 0),
     "@brief Returns the moved edge collection (does not modify self)\n"
     "\n"
     "Moves the edge collection by the given offset and returns the \n"
     "moved edge collection. The edge collection is not modified.\n"
     "\n"
-    "@param x The x distance to move the edge collection.\n"
-    "@param y The y distance to move the edge collection.\n"
+    "@param dx The x distance to move the edge collection.\n"
+    "@param dy The y distance to move the edge collection.\n"
     "\n"
     "@return The moved edge collection.\n"
   ) +
diff --git a/src/db/db/gsiDeclDbPath.cc b/src/db/db/gsiDeclDbPath.cc
index 1f8bc9b45..35cc28f52 100644
--- a/src/db/db/gsiDeclDbPath.cc
+++ b/src/db/db/gsiDeclDbPath.cc
@@ -208,17 +208,17 @@ struct path_defs
       "Returns the scaled object. All coordinates are multiplied with the given factor and if "
       "necessary rounded."
     ) +
-    method ("move", &C::move, gsi::arg ("p"),
+    method ("move", &C::move, gsi::arg ("v"),
       "@brief Moves the path.\n"
       "\n"
       "Moves the path by the given offset and returns the \n"
       "moved path. The path is overwritten.\n"
       "\n"
-      "@param p The distance to move the path.\n"
+      "@param v The distance to move the path.\n"
       "\n"
       "@return The moved path.\n"
     ) +
-    method_ext ("move", &move_xy, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Moves the path.\n"
       "\n"
       "Moves the path by the given offset and returns the \n"
@@ -231,17 +231,17 @@ struct path_defs
       "\n"
       "This version has been added in version 0.23.\n"
     ) +
-    method ("moved", &C::moved, gsi::arg ("p"),
+    method ("moved", &C::moved, gsi::arg ("v"),
       "@brief Returns the moved path (does not change self)\n"
       "\n"
       "Moves the path by the given offset and returns the \n"
       "moved path. The path is not modified.\n"
       "\n"
-      "@param p The distance to move the path.\n"
+      "@param v The distance to move the path.\n"
       "\n"
       "@return The moved path.\n"
     ) +
-    method_ext ("moved", &moved_xy, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Returns the moved path (does not change self)\n"
       "\n"
       "Moves the path by the given offset and returns the \n"
diff --git a/src/db/db/gsiDeclDbPoint.cc b/src/db/db/gsiDeclDbPoint.cc
index 34de7a1ad..02ce8cc84 100644
--- a/src/db/db/gsiDeclDbPoint.cc
+++ b/src/db/db/gsiDeclDbPoint.cc
@@ -36,6 +36,7 @@ template <class C>
 struct point_defs
 {
   typedef typename C::coord_type coord_type;
+  typedef typename C::vector_type vector_type;
 
   static C *from_string (const char *s)
   {
@@ -97,6 +98,28 @@ struct point_defs
     return std::hfunc (*pt);
   }
 
+  static C move_d (C *p, const vector_type &d)
+  {
+    *p += d;
+    return *p;
+  }
+
+  static C move_xy (C *p, coord_type dx, coord_type dy)
+  {
+    *p += vector_type (dx, dy);
+    return *p;
+  }
+
+  static C moved_d (const C *p, const vector_type &d)
+  {
+    return *p + d;
+  }
+
+  static C moved_xy (const C *p, coord_type dx, coord_type dy)
+  {
+    return *p + vector_type (dx, dy);
+  }
+
   static gsi::Methods methods ()
   {
     return
@@ -170,6 +193,56 @@ struct point_defs
       "\n"
       "This method has been introduced in version 0.25.\n"
     ) +
+    method_ext ("move", &move_d, gsi::arg ("v"),
+      "@brief Moves the point.\n"
+      "\n"
+      "This method is equivalent to '+='. It was introduced to harmonize the API "
+      "with the other objects. The point is modified.\n"
+      "\n"
+      "@param v The distance to move the point.\n"
+      "\n"
+      "@return The moved point.\n"
+      "\n"
+      "This method has been introduced in version 0.29.9."
+    ) +
+    method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
+      "@brief Moves the point.\n"
+      "\n"
+      "Moves the point by the given offset and returns the \n"
+      "moved point. The point is modified.\n"
+      "\n"
+      "@param dx The x distance to move the point.\n"
+      "@param dy The y distance to move the point.\n"
+      "\n"
+      "@return The moved point.\n"
+      "\n"
+      "This method has been introduced in version 0.29.9."
+    ) +
+    method_ext ("moved", &moved_d, gsi::arg ("v"),
+      "@brief Returns the moved point.\n"
+      "\n"
+      "This method is equivalent to '+'. It was introduced to harmonize the API "
+      "with the other objects. The point is not modified.\n"
+      "\n"
+      "@param v The distance to move the point.\n"
+      "\n"
+      "@return The moved point.\n"
+      "\n"
+      "This method has been introduced in version 0.29.9."
+    ) +
+    method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
+      "@brief Returns the moved point.\n"
+      "\n"
+      "Moves the point by the given offset and returns the \n"
+      "moved point. The point is not modified.\n"
+      "\n"
+      "@param dx The x distance to move the point.\n"
+      "@param dy The y distance to move the point.\n"
+      "\n"
+      "@return The moved point.\n"
+      "\n"
+      "This method has been introduced in version 0.29.9."
+    ) +
     method ("x", &C::x,
       "@brief Accessor to the x coordinate\n"
     ) +
diff --git a/src/db/db/gsiDeclDbPolygon.cc b/src/db/db/gsiDeclDbPolygon.cc
index f552ac1ff..97670a515 100644
--- a/src/db/db/gsiDeclDbPolygon.cc
+++ b/src/db/db/gsiDeclDbPolygon.cc
@@ -429,45 +429,45 @@ struct simple_polygon_defs
       "Returns the scaled object. All coordinates are multiplied with the given factor and if "
       "necessary rounded."
     ) +
-    method ("move", &C::move, gsi::arg ("p"),
+    method ("move", &C::move, gsi::arg ("v"),
       "@brief Moves the simple polygon.\n"
       "\n"
       "Moves the simple polygon by the given offset and returns the \n"
       "moved simple polygon. The polygon is overwritten.\n"
       "\n"
-      "@param p The distance to move the simple polygon.\n"
+      "@param v The distance to move the simple polygon.\n"
       "\n"
       "@return The moved simple polygon.\n"
     ) +
-    method_ext ("move", &move_xy, gsi::arg ("x"), gsi::arg ("y"),
+    method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Moves the polygon.\n"
       "\n"
       "Moves the polygon by the given offset and returns the \n"
       "moved polygon. The polygon is overwritten.\n"
       "\n"
-      "@param x The x distance to move the polygon.\n"
-      "@param y The y distance to move the polygon.\n"
+      "@param dx The x distance to move the polygon.\n"
+      "@param dy The y distance to move the polygon.\n"
       "\n"
       "@return The moved polygon (self).\n"
     ) +
-    method ("moved", &C::moved, gsi::arg ("p"),
+    method ("moved", &C::moved, gsi::arg ("v"),
       "@brief Returns the moved simple polygon\n"
       "\n"
       "Moves the simple polygon by the given offset and returns the \n"
       "moved simple polygon. The polygon is not modified.\n"
       "\n"
-      "@param p The distance to move the simple polygon.\n"
+      "@param v The distance to move the simple polygon.\n"
       "\n"
       "@return The moved simple polygon.\n"
     ) +
-    method_ext ("moved", &moved_xy, gsi::arg ("x"), gsi::arg ("y"),
+    method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Returns the moved polygon (does not modify self)\n"
       "\n"
       "Moves the polygon by the given offset and returns the \n"
       "moved polygon. The polygon is not modified.\n"
       "\n"
-      "@param x The x distance to move the polygon.\n"
-      "@param y The y distance to move the polygon.\n"
+      "@param dx The x distance to move the polygon.\n"
+      "@param dy The y distance to move the polygon.\n"
       "\n"
       "@return The moved polygon.\n"
       "\n"
@@ -1470,30 +1470,30 @@ struct polygon_defs
       "Returns the scaled object. All coordinates are multiplied with the given factor and if "
       "necessary rounded."
     ) +
-    method ("move", &C::move, gsi::arg ("p"),
+    method ("move", &C::move, gsi::arg ("v"),
       "@brief Moves the polygon.\n"
       "\n"
       "Moves the polygon by the given offset and returns the \n"
       "moved polygon. The polygon is overwritten.\n"
       "\n"
-      "@param p The distance to move the polygon.\n"
+      "@param v The distance to move the polygon.\n"
       "\n"
       "@return The moved polygon (self).\n"
       "\n"
       "This method has been introduced in version 0.23.\n"
     ) +
-    method_ext ("move", &move_xy, gsi::arg ("x"), gsi::arg ("y"),
+    method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Moves the polygon.\n"
       "\n"
       "Moves the polygon by the given offset and returns the \n"
       "moved polygon. The polygon is overwritten.\n"
       "\n"
-      "@param x The x distance to move the polygon.\n"
-      "@param y The y distance to move the polygon.\n"
+      "@param dx The x distance to move the polygon.\n"
+      "@param dy The y distance to move the polygon.\n"
       "\n"
       "@return The moved polygon (self).\n"
     ) +
-    method ("moved", &C::moved, gsi::arg ("p"),
+    method ("moved", &C::moved, gsi::arg ("v"),
       "@brief Returns the moved polygon (does not modify self)\n"
       "\n"
       "Moves the polygon by the given offset and returns the \n"
@@ -1505,14 +1505,14 @@ struct polygon_defs
       "\n"
       "This method has been introduced in version 0.23.\n"
     ) +
-    method_ext ("moved", &moved_xy, gsi::arg ("x"), gsi::arg ("y"),
+    method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Returns the moved polygon (does not modify self)\n"
       "\n"
       "Moves the polygon by the given offset and returns the \n"
       "moved polygon. The polygon is not modified.\n"
       "\n"
-      "@param x The x distance to move the polygon.\n"
-      "@param y The y distance to move the polygon.\n"
+      "@param dx The x distance to move the polygon.\n"
+      "@param dy The y distance to move the polygon.\n"
       "\n"
       "@return The moved polygon.\n"
       "\n"
diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc
index e42ab0b24..ee52cda6f 100644
--- a/src/db/db/gsiDeclDbRegion.cc
+++ b/src/db/db/gsiDeclDbRegion.cc
@@ -3039,14 +3039,14 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
     "\n"
     "@return The moved region (self).\n"
   ) +
-  method_ext ("move", &move_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
     "@brief Moves the region\n"
     "\n"
     "Moves the region by the given offset and returns the \n"
     "moved region. The region is overwritten.\n"
     "\n"
-    "@param x The x distance to move the region.\n"
-    "@param y The y distance to move the region.\n"
+    "@param dx The x distance to move the region.\n"
+    "@param dy The y distance to move the region.\n"
     "\n"
     "@return The moved region (self).\n"
   ) +
@@ -3058,18 +3058,18 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
     "\n"
     "Starting with version 0.25 this method accepts a vector argument.\n"
     "\n"
-    "@param p The distance to move the region.\n"
+    "@param v The distance to move the region.\n"
     "\n"
     "@return The moved region.\n"
   ) +
-  method_ext ("moved", &moved_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
     "@brief Returns the moved region (does not modify self)\n"
     "\n"
     "Moves the region by the given offset and returns the \n"
     "moved region. The region is not modified.\n"
     "\n"
-    "@param x The x distance to move the region.\n"
-    "@param y The y distance to move the region.\n"
+    "@param dx The x distance to move the region.\n"
+    "@param dy The y distance to move the region.\n"
     "\n"
     "@return The moved region.\n"
   ) +
diff --git a/src/db/db/gsiDeclDbText.cc b/src/db/db/gsiDeclDbText.cc
index be37cf36e..d37c71bb6 100644
--- a/src/db/db/gsiDeclDbText.cc
+++ b/src/db/db/gsiDeclDbText.cc
@@ -296,18 +296,18 @@ struct text_defs
       "\n"
       "See \\valign= for a description of this property.\n"
     ) +
-    method_ext ("move", &move, gsi::arg ("distance"),
+    method_ext ("move", &move, gsi::arg ("v"),
       "@brief Moves the text by a certain distance (modifies self)\n"
       "\n"
       "\n"
       "Moves the text by a given offset and returns the moved\n"
       "text. Does not check for coordinate overflows.\n"
       "\n"
-      "@param p The offset to move the text.\n"
+      "@param v The offset to move the text.\n"
       "\n"
       "@return A reference to this text object\n"
     ) +
-    method_ext ("move", &move_xy, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Moves the text by a certain distance (modifies self)\n"
       "\n"
       "\n"
@@ -321,7 +321,7 @@ struct text_defs
       "\n"
       "This method was introduced in version 0.23."
     ) +
-    method_ext ("moved", &moved, gsi::arg ("distance"),
+    method_ext ("moved", &moved, gsi::arg ("v"),
       "@brief Returns the text moved by a certain distance (does not modify self)\n"
       "\n"
       "\n"
@@ -329,11 +329,11 @@ struct text_defs
       "text. Does not modify *this. Does not check for coordinate\n"
       "overflows.\n"
       "\n"
-      "@param p The offset to move the text.\n"
+      "@param v The offset to move the text.\n"
       "\n"
       "@return The moved text.\n"
     ) +
-    method_ext ("moved", &moved_xy, gsi::arg ("dx"), gsi::arg ("dy"),
+    method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
       "@brief Returns the text moved by a certain distance (does not modify self)\n"
       "\n"
       "\n"
diff --git a/src/db/db/gsiDeclDbTexts.cc b/src/db/db/gsiDeclDbTexts.cc
index 359249795..5696f682e 100644
--- a/src/db/db/gsiDeclDbTexts.cc
+++ b/src/db/db/gsiDeclDbTexts.cc
@@ -484,45 +484,45 @@ Class<db::Texts> decl_Texts (decl_dbShapeCollection, "db", "Texts",
     "\n"
     "The 'join_with' alias has been introduced in version 0.28.12."
   ) +
-  method_ext ("move", &move_p, gsi::arg ("p"),
+  method_ext ("move", &move_p, gsi::arg ("v"),
     "@brief Moves the text collection\n"
     "\n"
     "Moves the texts by the given offset and returns the \n"
     "moved text collection. The text collection is overwritten.\n"
     "\n"
-    "@param p The distance to move the texts.\n"
+    "@param v The distance to move the texts.\n"
     "\n"
     "@return The moved texts (self).\n"
   ) +
-  method_ext ("move", &move_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("move", &move_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
     "@brief Moves the text collection\n"
     "\n"
     "Moves the edge pairs by the given offset and returns the \n"
     "moved texts. The edge pair collection is overwritten.\n"
     "\n"
-    "@param x The x distance to move the texts.\n"
-    "@param y The y distance to move the texts.\n"
+    "@param dx The x distance to move the texts.\n"
+    "@param dy The y distance to move the texts.\n"
     "\n"
     "@return The moved texts (self).\n"
   ) +
-  method_ext ("moved", &moved_p, gsi::arg ("p"),
+  method_ext ("moved", &moved_p, gsi::arg ("v"),
     "@brief Returns the moved text collection (does not modify self)\n"
     "\n"
     "Moves the texts by the given offset and returns the \n"
     "moved texts. The text collection is not modified.\n"
     "\n"
-    "@param p The distance to move the texts.\n"
+    "@param v The distance to move the texts.\n"
     "\n"
     "@return The moved texts.\n"
   ) +
-  method_ext ("moved", &moved_xy, gsi::arg ("x"), gsi::arg ("y"),
+  method_ext ("moved", &moved_xy, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
     "@brief Returns the moved edge pair collection (does not modify self)\n"
     "\n"
     "Moves the texts by the given offset and returns the \n"
     "moved texts. The text collection is not modified.\n"
     "\n"
-    "@param x The x distance to move the texts.\n"
-    "@param y The y distance to move the texts.\n"
+    "@param dx The x distance to move the texts.\n"
+    "@param dy The y distance to move the texts.\n"
     "\n"
     "@return The moved texts.\n"
   ) +


Test patch:
diff --git a/testdata/ruby/dbPointTest.rb b/testdata/ruby/dbPointTest.rb
index 248ae939b..647a97ae1 100644
--- a/testdata/ruby/dbPointTest.rb
+++ b/testdata/ruby/dbPointTest.rb
@@ -163,6 +163,28 @@ def test_4_Point
 
   end
 
+  # move/moved
+  def test_5_Point
+
+    p1 = RBA::DPoint::new(1, 2)
+    assert_equal(p1.moved(2, 3).to_s, "3,5")
+    assert_equal(p1.to_s, "1,2")
+    assert_equal(p1.move(2, 3).to_s, "3,5")
+    assert_equal(p1.to_s, "3,5")
+
+    p1 = RBA::DPoint::new(1, 2)
+    assert_equal(p1.moved(RBA::DVector::new(2, 3)).to_s, "3,5")
+    assert_equal(p1.to_s, "1,2")
+    assert_equal(p1.move(RBA::DVector::new(2, 3)).to_s, "3,5")
+    assert_equal(p1.to_s, "3,5")
+
+    p1 = RBA::DPoint::new(1, 2)
+    assert_equal(p1.moved(:dx => 1).to_s, "2,2")
+    p1.move(:dy => 3)
+    assert_equal(p1.to_s, "1,5")
+
+  end
+
 end
 
 load("test_epilogue.rb")