mirror of https://github.com/KLayout/klayout.git
DRC bugfix: layer wasn't overwritten but added on output.
This commit is contained in:
parent
dbe8c62177
commit
2e9fb9fe9a
|
|
@ -4867,37 +4867,31 @@ CODE
|
||||||
# make sure the output has the right database unit
|
# make sure the output has the right database unit
|
||||||
output.dbu = self.dbu
|
output.dbu = self.dbu
|
||||||
|
|
||||||
if data.respond_to?(:is_deep?) && data.is_deep?
|
tmp = li
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
# mark the layer as used
|
|
||||||
if !@used_output_layers[li]
|
if !@used_output_layers[li]
|
||||||
@output_layers.push(li)
|
@output_layers.push(li)
|
||||||
|
# Note: to avoid issues with output onto the input layer, we
|
||||||
|
# output to a temp layer and later swap both. The simple implementation
|
||||||
|
# did a clear here and the effect of that was that the data potentially
|
||||||
|
# got invalidated.
|
||||||
|
tmp = output.insert_layer(RBA::LayerInfo::new)
|
||||||
@used_output_layers[li] = true
|
@used_output_layers[li] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
# insert the data into the output layer
|
if data.respond_to?(:is_deep?) && data.is_deep?
|
||||||
if data.is_a?(RBA::EdgePairs)
|
|
||||||
data.insert_into_as_polygons(output, output_cell.cell_index, li, 1)
|
|
||||||
else
|
|
||||||
data.insert_into(output, output_cell.cell_index, li)
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
# insert the data into the output layer
|
||||||
|
if data.is_a?(RBA::EdgePairs)
|
||||||
tmp = li
|
data.insert_into_as_polygons(output, output_cell.cell_index, tmp, 1)
|
||||||
|
else
|
||||||
begin
|
data.insert_into(output, output_cell.cell_index, tmp)
|
||||||
|
|
||||||
if !@used_output_layers[li]
|
|
||||||
@output_layers.push(li)
|
|
||||||
# Note: to avoid issues with output onto the input layer, we
|
|
||||||
# output to a temp layer and later swap both. The simple implementation
|
|
||||||
# did a clear here and the effect of that was that the data potentially
|
|
||||||
# got invalidated.
|
|
||||||
tmp = output.insert_layer(RBA::LayerInfo::new)
|
|
||||||
@used_output_layers[li] = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
# insert the data into the output layer
|
# insert the data into the output layer
|
||||||
if data.is_a?(RBA::EdgePairs)
|
if data.is_a?(RBA::EdgePairs)
|
||||||
output_cell.shapes(tmp).insert_as_polygons(data, 1)
|
output_cell.shapes(tmp).insert_as_polygons(data, 1)
|
||||||
|
|
@ -4905,18 +4899,18 @@ CODE
|
||||||
output_cell.shapes(tmp).insert(data)
|
output_cell.shapes(tmp).insert(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
# make the temp layer the output layer
|
|
||||||
if tmp != li
|
|
||||||
output.swap_layers(tmp, li)
|
|
||||||
end
|
|
||||||
|
|
||||||
ensure
|
|
||||||
# clean up the original layer if requested
|
|
||||||
if tmp != li
|
|
||||||
output.delete_layer(tmp)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# make the temp layer the output layer
|
||||||
|
if tmp != li
|
||||||
|
output.swap_layers(tmp, li)
|
||||||
|
end
|
||||||
|
|
||||||
|
ensure
|
||||||
|
# clean up the original layer if requested
|
||||||
|
if tmp != li
|
||||||
|
output.delete_layer(tmp)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue