Skip to content

Commit

Permalink
Make text of reference smaller to fit into rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
florianfesti committed May 11, 2024
1 parent d65f984 commit d2422e4
Show file tree
Hide file tree
Showing 148 changed files with 10,800 additions and 10,788 deletions.
10 changes: 5 additions & 5 deletions boxes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def __init__(self) -> None:
"--labels", action="store", type=boolarg, default=True,
help="label the parts (where available)")
defaultgroup.add_argument(
"--reference", action="store", type=float, default=100,
"--reference", action="store", type=float, default=100.0,
help="print reference rectangle with given length (in mm)(zero to disable) [\U0001F6C8](https://florianfesti.github.io/boxes/html/usermanual.html#reference)")
defaultgroup.add_argument(
"--inner_corners", action="store", type=str, default="loop",
Expand Down Expand Up @@ -402,11 +402,11 @@ def open(self):
self.move(self.reference, 10, "up", before=True)
self.ctx.rectangle(0, 0, self.reference, 10)
if self.reference < 80:
self.text(f"{self.reference:.2f}mm, burn:{self.burn:.2f}mm", self.reference + 5, 5,
fontsize=8, align="middle left", color=Color.ANNOTATIONS)
self.text(f"{self.reference:.1f}mm, burn:{self.burn:.2f}mm", self.reference + 5, 5,
fontsize=6, align="middle left", color=Color.ANNOTATIONS)
else:
self.text(f"{self.reference:.2f}mm, burn:{self.burn:.2f}mm", self.reference / 2.0, 5,
fontsize=8, align="middle center", color=Color.ANNOTATIONS)
self.text(f"{self.reference:.1f}mm, burn:{self.burn:.2f}mm", self.reference / 2.0, 5,
fontsize=6, align="middle center", color=Color.ANNOTATIONS)
self.move(self.reference, 10, "up")
if self.qr_code:
self.renderQrCode()
Expand Down
72 changes: 36 additions & 36 deletions examples/ABox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
394 changes: 197 additions & 197 deletions examples/AgricolaInsert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,134 changes: 567 additions & 567 deletions examples/AirPurifier.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/AllEdges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 28 additions & 28 deletions examples/AngledBox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 34 additions & 34 deletions examples/AngledCutJig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
442 changes: 221 additions & 221 deletions examples/Arcade.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
510 changes: 255 additions & 255 deletions examples/Atreus21.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 37 additions & 37 deletions examples/BasedBox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 33 additions & 33 deletions examples/BayonetBox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
282 changes: 141 additions & 141 deletions examples/BinTray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 26 additions & 26 deletions examples/BirdHouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions examples/BottleStack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions examples/BottleTag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d2422e4

Please sign in to comment.