Merge pull request #448 from flaviut/flaviut-patch-1

Fix type error
This commit is contained in:
Salvador E. Tropea 2023-05-29 11:02:12 -03:00 committed by GitHub
commit 23a4aa3fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -49,9 +49,7 @@ def do_round(v, dig):
def to_mm(iu, dig=2):
""" KiCad Internal Units to millimeters """
if isinstance(iu, pcbnew.wxPoint):
return (do_round(GS.to_mm(iu.x), dig), do_round(GS.to_mm(iu.y), dig))
if isinstance(iu, pcbnew.wxSize):
if hasattr(iu, 'x'):
return (do_round(GS.to_mm(iu.x), dig), do_round(GS.to_mm(iu.y), dig))
return do_round(GS.to_mm(iu), dig)