# HG changeset patch # User Andrey Skvortsov # Date 1484326296 -10800 # Node ID 940e20a8865bc18e2004e81580ea219e581b6abb # Parent f0030c3cd6ab076b3e1860df8d10e7bb4b444b38 fix issue with printing scheme (FBD, LD or SFC) with comment element on GNU/Linux If you draw FBD scheme and place comment on it and then try to print it, then no wires will be printed and comment box is empty (text is missing). This happens only for wx.PrinterDC and not on wx.MemoryDC that is used to draw print preview window in Beremiz IDE. Looks like a bug in wxPython or wxWidgets. There were found several workaround for this issue. 1) If some dc.DrawLines call is placed before dc.DrawPolygon, then the problem is gone. ... dc.DrawLines(polygon) dc.DrawPolygon(polygon) ... 2) Reseting DC brush solves the problem as well (see this changeset). diff -r f0030c3cd6ab -r 940e20a8865b graphics/GraphicCommons.py --- a/graphics/GraphicCommons.py Fri Jan 13 16:47:46 2017 +0300 +++ b/graphics/GraphicCommons.py Fri Jan 13 19:51:36 2017 +0300 @@ -2895,10 +2895,15 @@ wx.Point(self.Pos.x + self.Size[0], self.Pos.y + self.Size[1]), wx.Point(self.Pos.x, self.Pos.y + self.Size[1])] dc.DrawPolygon(polygon) + + # dc.SetBrush call is workaround for the issue with wx.PrinterDC + # with wxPython 3.0 on GNU/Linux (don't remove it) + dc.SetBrush(wx.WHITE_BRUSH) lines = [wx.Point(self.Pos.x + self.Size[0] - 10, self.Pos.y), wx.Point(self.Pos.x + self.Size[0] - 10, self.Pos.y + 10), wx.Point(self.Pos.x + self.Size[0], self.Pos.y + 10)] dc.DrawLines(lines) + # Draws the comment content y = self.Pos.y + 10 for idx, line in enumerate(self.Content.splitlines()):