Skip to content

Commit

Permalink
Merge pull request #1091 from IgorYeremin/fix-arcpen-2d
Browse files Browse the repository at this point in the history
Fix G2/G3 arc rendering error and scaling in 2D view
  • Loading branch information
kliment authored Aug 11, 2020
2 parents 2505b3e + eb0562a commit ac1a621
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions printrun/gviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __init__(self, parent, size = (200, 200), build_dimensions = [200, 200, 100,
self.travelpen = wx.Pen(wx.Colour(10, 80, 80), penwidth)
self.hlpen = wx.Pen(wx.Colour(200, 50, 50), penwidth)
self.fades = [wx.Pen(wx.Colour(int(250 - 0.6 ** i * 100), int(250 - 0.6 ** i * 100), int(200 - 0.4 ** i * 50)), penwidth) for i in range(6)]
self.penslist = [self.mainpen, self.travelpen, self.hlpen] + self.fades
self.penslist = [self.mainpen, self.arcpen, self.travelpen, self.hlpen] + self.fades
self.bgcolor = wx.Colour()
self.bgcolor.Set(bgcolor)
self.blitmap = wx.Bitmap(self.GetClientSize()[0], self.GetClientSize()[1], -1)
Expand Down Expand Up @@ -320,7 +320,7 @@ def _drawarcs(self, dc, arcs, pens):
scaled_arcs = [self._arc_scaler(a) for a in arcs]
dc.SetBrush(wx.TRANSPARENT_BRUSH)
for i in range(len(scaled_arcs)):
dc.SetPen(pens[i] if isinstance(pens, list) else pens)
dc.SetPen(pens[i] if isinstance(pens, numpy.ndarray) else pens)
dc.DrawArc(*scaled_arcs[i])

def repaint_everything(self):
Expand Down

0 comments on commit ac1a621

Please sign in to comment.