summaryrefslogtreecommitdiff
path: root/gerber
diff options
context:
space:
mode:
Diffstat (limited to 'gerber')
-rwxr-xr-xgerber/excellon.py2
-rw-r--r--gerber/primitives.py3
-rw-r--r--gerber/render/cairo_backend.py2
3 files changed, 4 insertions, 3 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py
index 708f50b..4ff2161 100755
--- a/gerber/excellon.py
+++ b/gerber/excellon.py
@@ -126,7 +126,7 @@ class ExcellonFile(CamFile):
@property
def primitives(self):
- return [Drill(hit.position, hit.tool.diameter,units=self.settings.units) for hit in self.hits]
+ return [Drill(hit.position, hit.tool.diameter, hit, units=self.settings.units) for hit in self.hits]
@property
diff --git a/gerber/primitives.py b/gerber/primitives.py
index 0ac12af..1e26f19 100644
--- a/gerber/primitives.py
+++ b/gerber/primitives.py
@@ -741,11 +741,12 @@ class SquareRoundDonut(Primitive):
class Drill(Primitive):
""" A drill hole
"""
- def __init__(self, position, diameter, **kwargs):
+ def __init__(self, position, diameter, hit, **kwargs):
super(Drill, self).__init__('dark', **kwargs)
validate_coordinates(position)
self.position = position
self.diameter = diameter
+ self.hit = hit
self._to_convert = ['position', 'diameter']
@property
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index 81c5ce4..4a0724f 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -124,7 +124,7 @@ class GerberCairoContext(GerberContext):
self.ctx.set_source_rgba(color[0], color[1], color[2], self.alpha)
self.ctx.set_operator(cairo.OPERATOR_OVER if (rectangle.level_polarity == "dark" and not self.invert) else cairo.OPERATOR_CLEAR)
self.ctx.set_line_width(0)
- self.ctx.rectangle(*ll,width=width, height=height)
+ self.ctx.rectangle(ll[0], ll[1], width, height)
self.ctx.fill()
def _render_obround(self, obround, color):