hohlraum / gdsCAD

A simple but powerful Python package for creating photolithography masks in the GDSII format.
GNU General Public License v3.0
88 stars 52 forks source link

Viewing area is not rescaled to text in shifted references #23

Open hohlraum opened 9 years ago

hohlraum commented 9 years ago

Matplotlib's autoscale does not take artists added by add_artist into account when calculating dataLim. f27da5b1defb67ab19d4047f1df258000fcc5971 introduces an ugly hack to explicitly add text objects to the datalim. It more or less works for cells, but not for references that have been subjected to transformations.

For instance in the code below c.show() works as expected, but top.show() does not.

t1 = core.Text('one', (-10,0), layer=8)
t2 = core.Text('two', (0,5))
t3 = core.Text('three', (-20,5))
t4 = core.Text('four', (10,0))

c = core.Cell('cell')
c.add([t1, t2, t3, t4])

ref = core.CellReference(c, origin=(10,10))

top = core.Cell('top')
top.add(ref)