summaryrefslogtreecommitdiff
path: root/gerbonara
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-06-10 11:10:23 +0200
committerjaseg <git@jaseg.de>2022-06-10 22:11:39 +0200
commitb1be792c5200b6af58773486ac060e247e8c2514 (patch)
treee3fb21e80b2dcb0cd30c99a2c78cd5a8277f661d /gerbonara
parent460ea625af5c1d9e243feaa49923f7b2c7db8837 (diff)
downloadgerbonara-0.10.0.tar.gz
gerbonara-0.10.0.tar.bz2
gerbonara-0.10.0.zip
Fix testsv0.10.0
Diffstat (limited to 'gerbonara')
-rw-r--r--gerbonara/graphic_primitives.py2
-rw-r--r--gerbonara/layers.py2
-rw-r--r--gerbonara/tests/image_support.py8
3 files changed, 9 insertions, 3 deletions
diff --git a/gerbonara/graphic_primitives.py b/gerbonara/graphic_primitives.py
index 7bbd3ff..dd421a7 100644
--- a/gerbonara/graphic_primitives.py
+++ b/gerbonara/graphic_primitives.py
@@ -23,7 +23,7 @@ from dataclasses import dataclass, KW_ONLY, replace
from .utils import *
-prec = lambda x: f'{x:.6}'
+prec = lambda x: f'{float(x):.6}'
@dataclass
diff --git a/gerbonara/layers.py b/gerbonara/layers.py
index c429910..4fcc6e3 100644
--- a/gerbonara/layers.py
+++ b/gerbonara/layers.py
@@ -345,7 +345,7 @@ class LayerStack:
layer = LazyCamFile(GerberFile, path)
if not lazy:
- layer = layer.open()
+ layer = layer.instance
if key == 'mechanical outline':
layers['mechanical', 'outline'] = layer
diff --git a/gerbonara/tests/image_support.py b/gerbonara/tests/image_support.py
index f1d468c..0c47c8b 100644
--- a/gerbonara/tests/image_support.py
+++ b/gerbonara/tests/image_support.py
@@ -172,7 +172,13 @@ def gerber_difference(reference, actual, diff_out=None, svg_transform=None, size
with svg_soup(ref_svg.name) as soup:
if svg_transform is not None:
- soup.find('g', attrs={'id': 'surface1'})['transform'] = svg_transform
+ svg = soup.svg
+ children = list(svg.children)
+ g = soup.new_tag('g', attrs={'transform': svg_transform})
+ for c in children:
+ g.append(c.extract())
+ svg.append(g)
+
cleanup_gerbv_svg(soup)
with svg_soup(act_svg.name) as soup: