mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-04 08:43:42 +02:00
Added a convenience binding for vector+point
This way, the vector/point sum is commutable. vector+point == point+vector.
This commit is contained in:
Vendored
+10
@@ -55,6 +55,11 @@ class DBVector_TestClass < TestBase
|
||||
b.y = a.y
|
||||
assert_equal( a, b )
|
||||
|
||||
assert_equal( c.to_p.class == RBA::DPoint, true )
|
||||
assert_equal( c.class == RBA::DVector, true )
|
||||
assert_equal( (c + RBA::DPoint::new(1, 2)).class == RBA::DPoint, true )
|
||||
assert_equal( (c + RBA::DPoint::new(1, 2)).to_s, "6,13" )
|
||||
|
||||
end
|
||||
|
||||
# Transforming DVector
|
||||
@@ -101,6 +106,11 @@ class DBVector_TestClass < TestBase
|
||||
b.y = a.y
|
||||
assert_equal( a, b )
|
||||
|
||||
assert_equal( c.to_p.class == RBA::Point, true )
|
||||
assert_equal( c.class == RBA::Vector, true )
|
||||
assert_equal( (c + RBA::Point::new(1, 2)).class == RBA::Point, true )
|
||||
assert_equal( (c + RBA::Point::new(1, 2)).to_s, "6,13" )
|
||||
|
||||
end
|
||||
|
||||
# Transforming Vector
|
||||
|
||||
Reference in New Issue
Block a user