Tiny enhancement of LayoutView#insert_layer

* returns a non-const reference now which can be modified
* the node parameter is optional and initialized with a default node
This commit is contained in:
Matthias Koefferlein
2018-09-01 11:39:20 +02:00
parent c9771f54eb
commit c4c1630a38
3 changed files with 116 additions and 184 deletions
+1 -1
View File
@@ -398,7 +398,7 @@ class LAYLayers_TestClass < TestBase
new_p.clear_children
assert_equal(new_p.has_children?, false)
assert_equal(ll.has_children?, true)
assert_equal(ll.has_children?, false)
cv.transaction("Delete")
li = cv.begin_layers(0)
+24
View File
@@ -375,6 +375,30 @@ class LAYLayoutView_TestClass < TestBase
end
def test_3
# standalone layout view
lv = RBA::LayoutView::new
cv = lv.cellview(lv.create_layout(1))
cv.layout.create_cell("TOP")
cv.cell = cv.layout.top_cell
assert_equal(lv.cellview(cv.index).cell.name, "TOP")
# insert layer with default initializer
lp = lv.insert_layer(lv.begin_layers)
lp.fill_color = 0xffff31cc
assert_equal(lv.begin_layers.current.fill_color, 0xffff31cc)
lv.clear_layers
lp = lv.insert_layer(0, lv.begin_layers)
lp.fill_color = 0xffff31cc
assert_equal(lv.begin_layers.current.fill_color, 0xffff31cc)
end
end
load("test_epilogue.rb")