DrillBox: Fix font size

Now that the text() function has a fontsize parameter, setting the font size
on ctx before calling text() has no impact.

Resolves: #173

Thanks to Marko Luther for reporting and suggesting this fix!
This commit is contained in:
Florian Festi 2019-09-23 12:15:49 +02:00
parent 3ba90c517c
commit d6495fc7b4
1 changed files with 1 additions and 2 deletions

View File

@ -42,13 +42,12 @@ in 0.5mm steps, 3 holes each size"""
self.hole(i * 20 + 10, j * 60 + k * 20 + 10, r + 0.05) self.hole(i * 20 + 10, j * 60 + k * 20 + 10, r + 0.05)
def descriptionText(self): def descriptionText(self):
self.ctx.set_font_size(6)
for i in range(4): for i in range(4):
for j in range(6): for j in range(6):
self.rectangularHole(i * 60 + 30, 20 * j + 10, 58, 14 + 1 * j) self.rectangularHole(i * 60 + 30, 20 * j + 10, 58, 14 + 1 * j)
d = 2.5 - 0.5 * i + 2 * j d = 2.5 - 0.5 * i + 2 * j
self.text("%.1f" % d, i * 60 + 20, 19 * j + 6, self.text("%.1f" % d, i * 60 + 20, 19 * j + 6,
align="center") align="center", fontsize=6)
def render(self): def render(self):
x, y, h = self.x, self.y, self.h x, y, h = self.x, self.y, self.h