Skip to content

Commit

Permalink
Fixing issue #1942 (PythonStandalone Package stubs errors), adding de…
Browse files Browse the repository at this point in the history
…faults for Box#enlarge and Box#enlarged (bonus)
  • Loading branch information
Matthias Koefferlein committed Dec 2, 2024
1 parent 998a780 commit dd5214d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/db/db/gsiDeclDbBox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ struct box_defs
"\n"
"@return A reference to this box.\n"
) +
method_ext ("moved", &box_defs<C>::moved, gsi::arg ("dx, 0"), gsi::arg ("dy", 0),
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"
"This is a convenience method which takes two values instead of a Point object.\n"
Expand Down Expand Up @@ -419,7 +419,7 @@ struct box_defs
"\n"
"@return The moved box.\n"
) +
method_ext ("enlarge", &box_defs<C>::enlarge, gsi::arg ("dx"), gsi::arg ("dy"),
method_ext ("enlarge", &box_defs<C>::enlarge, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
"@brief Enlarges the box by a certain amount.\n"
"\n"
"\n"
Expand All @@ -436,7 +436,7 @@ struct box_defs
"\n"
"@return A reference to this box.\n"
) +
method_ext ("enlarged", &box_defs<C>::enlarged, gsi::arg ("dx"), gsi::arg ("dy"),
method_ext ("enlarged", &box_defs<C>::enlarged, gsi::arg ("dx", 0), gsi::arg ("dy", 0),
"@brief Enlarges the box by a certain amount.\n"
"\n"
"\n"
Expand Down
9 changes: 9 additions & 0 deletions testdata/ruby/dbBoxTest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ def test_1_Box
assert_equal( a.to_s, "(-9,18;12,22)" )
a = b.moved( 1, -1 )
assert_equal( a.to_s, "(-9,16;12,20)" )
a = b.moved( dy: 1 )
assert_equal( a.to_s, "(-10,18;11,22)" )
a = b.moved( dx: 1 )
assert_equal( a.to_s, "(-9,17;12,21)" )

a = b.dup
a.move( 1, -1 )
Expand Down Expand Up @@ -304,7 +308,12 @@ def test_1_Box
aa = a.dup
a.enlarge( -1, 1 )
assert_equal( a.to_s, "(-10,21;11,25)" )
a.enlarge( 1, -1 )
a.enlarge( dy: 1 )
a.enlarge( dx: -1 )
assert_equal( a.to_s, "(-10,21;11,25)" )
assert_equal( aa.enlarged( -1, 1 ).to_s, "(-10,21;11,25)" )
assert_equal( aa.enlarged( :dy => 1, :dx => -1 ).to_s, "(-10,21;11,25)" )

a = a.enlarged( RBA::Point::new(1, -1) )
assert_equal( a.to_s, "(-11,22;12,24)" )
Expand Down

0 comments on commit dd5214d

Please sign in to comment.