mirror of https://github.com/KLayout/klayout.git
Fixing issue #1942 (PythonStandalone Package stubs errors), adding defaults for Box#enlarge and Box#enlarged (bonus)
This commit is contained in:
parent
998a780676
commit
dd5214dc6e
|
|
@ -388,7 +388,7 @@ struct box_defs
|
||||||
"\n"
|
"\n"
|
||||||
"@return A reference to this box.\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"
|
"@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 is a convenience method which takes two values instead of a Point object.\n"
|
||||||
|
|
@ -419,7 +419,7 @@ struct box_defs
|
||||||
"\n"
|
"\n"
|
||||||
"@return The moved box.\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"
|
"@brief Enlarges the box by a certain amount.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
@ -436,7 +436,7 @@ struct box_defs
|
||||||
"\n"
|
"\n"
|
||||||
"@return A reference to this box.\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"
|
"@brief Enlarges the box by a certain amount.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,10 @@ class DBBox_TestClass < TestBase
|
||||||
assert_equal( a.to_s, "(-9,18;12,22)" )
|
assert_equal( a.to_s, "(-9,18;12,22)" )
|
||||||
a = b.moved( 1, -1 )
|
a = b.moved( 1, -1 )
|
||||||
assert_equal( a.to_s, "(-9,16;12,20)" )
|
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 = b.dup
|
||||||
a.move( 1, -1 )
|
a.move( 1, -1 )
|
||||||
|
|
@ -304,7 +308,12 @@ class DBBox_TestClass < TestBase
|
||||||
aa = a.dup
|
aa = a.dup
|
||||||
a.enlarge( -1, 1 )
|
a.enlarge( -1, 1 )
|
||||||
assert_equal( a.to_s, "(-10,21;11,25)" )
|
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( -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) )
|
a = a.enlarged( RBA::Point::new(1, -1) )
|
||||||
assert_equal( a.to_s, "(-11,22;12,24)" )
|
assert_equal( a.to_s, "(-11,22;12,24)" )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue