Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix G2/G3 arc rendering error and scaling in 2D view #1091

Merged
merged 2 commits into from
Aug 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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