From 9a3776e758ff2d3dc13a6aacb60de8d7228a4eb7 Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 14 Dec 2020 14:18:00 -0800 Subject: [PATCH] Use default zoom for text --- compiler/base/geometry.py | 9 ++++++--- compiler/base/pin_layout.py | 6 ++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/base/geometry.py b/compiler/base/geometry.py index 6d39a7dd..177f50e0 100644 --- a/compiler/base/geometry.py +++ b/compiler/base/geometry.py @@ -446,7 +446,7 @@ class path(geometry): class label(geometry): """Represents a text label""" - def __init__(self, text, lpp, offset, zoom=-1): + def __init__(self, text, lpp, offset, zoom=None): """Initializes a text label for specified layer""" super().__init__() self.name = "label" @@ -455,8 +455,11 @@ class label(geometry): self.layerPurpose = lpp[1] self.offset = vector(offset).snap_to_grid() - if zoom<0: - self.zoom = tech.GDS["zoom"] + if not zoom: + try: + self.zoom = tech.GDS["zoom"] + except: + self.zoom = None else: self.zoom = zoom diff --git a/compiler/base/pin_layout.py b/compiler/base/pin_layout.py index 21bad6bc..73f38d3e 100644 --- a/compiler/base/pin_layout.py +++ b/compiler/base/pin_layout.py @@ -393,15 +393,13 @@ class pin_layout: width=self.width(), height=self.height(), center=False) - # Add the tet in the middle of the pin. + # Add the text in the middle of the pin. # This fixes some pin label offsetting when GDS gets # imported into Magic. newLayout.addText(text=self.name, layerNumber=layer_num, purposeNumber=label_purpose, - offsetInMicrons=self.center(), - magnification=GDS["zoom"], - rotate=None) + offsetInMicrons=self.center()) def compute_overlap(self, other): """ Calculate the rectangular overlap of two rectangles. """