jwdj / EasyABC

EasyABC
GNU General Public License v2.0
87 stars 36 forks source link

svg renderer needs to pass proper ints to some wx APIs #53

Closed robertmuth closed 1 year ago

robertmuth commented 2 years ago

Otherwise score rendering is broken on Ubuntu 22.04 (python3.10)

This diff fixes that:

  diff --git a/svgrenderer.py b/svgrenderer.py
  index f229d7e..8b54329 100644
  --- a/svgrenderer.py
  +++ b/svgrenderer.py
  @@ -620,7 +620,7 @@ class SvgRenderer(object):
                       #     wxpen.Style(wx.USER_DASH)
                       wxpen.Join(wx.JOIN_MITER)
                   else:
  -                    wxpen = wx.Pen(wx_colour(svg_stroke), line_width)
  +                    wxpen = wx.Pen(wx_colour(svg_stroke), int(line_width))
                       if linecap == 'butt':
                           wxpen.SetCap(wx.CAP_BUTT)
                       elif linecap == 'round':
  @@ -810,7 +810,7 @@ class SvgRenderer(object):
                       elif fi == 'italic':
                           font_style = wx.FONTSTYLE_ITALIC
                       elif fi.endswith('px'):
  -                        font_size = float(fi[0:-2])
  +                        font_size = int(float(fi[0:-2]))
                       elif fi in ['serif','sans-serif','monospace','bookman']:
                           svg_font_family = fi