MCPcopy Index your code
hub / github.com/WhyNotHugo/python-barcode / _paint_module

Method _paint_module

barcode/writer.py:456–464  ·  view source on GitHub ↗
(self, xpos: float, ypos: float, width: float, color)

Source from the content-addressed store, hash-verified

454 self._draw = ImageDraw.Draw(self._image)
455
456 def _paint_module(self, xpos: float, ypos: float, width: float, color):
457 size = [
458 (mm2px(xpos, self.dpi), mm2px(ypos, self.dpi)),
459 (
460 mm2px(xpos + width, self.dpi) - 1,
461 mm2px(ypos + self.module_height, self.dpi),
462 ),
463 ]
464 self._draw.rectangle(size, outline=color, fill=color)
465
466 def _paint_text(self, xpos, ypos):
467 assert ImageFont is not None

Callers

nothing calls this directly

Calls 1

mm2pxFunction · 0.85

Tested by

no test coverage detected