Skip to content

Commit

Permalink
Add fixed size of aperture miniatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Oct 3, 2024
1 parent 3f63881 commit df499b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pygerber/gerber/language_server/_server/hover/gerber.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
from pygerber.gerber.spec import rev_2024_05 as spec
from pygerber.vm import render
from pygerber.vm.pillow import PillowResult
from pygerber.vm.types.style import Style

if TYPE_CHECKING:
from PIL import Image
Expand Down Expand Up @@ -466,11 +467,14 @@ def _visualize_draw_op(self, extra_commands: list[Node]) -> None:
)
nodes.extend(extra_commands)

rvmc = compile(File(nodes=nodes))
result = render(rvmc, dpmm=100)
bytecode = compile(File(nodes=nodes))
temp_result = render(bytecode, dpmm=1)

dpmm = 200 / temp_result.main_box.width
result = render(bytecode, dpmm=dpmm)
assert isinstance(result, PillowResult)

tag = self._base64_image_tag(result.get_image())
tag = self._base64_image_tag(result.get_image(Style.presets.COPPER_ALPHA))

self._print_line(tag)

Expand Down

0 comments on commit df499b9

Please sign in to comment.