# HG changeset patch # User Edouard Tisserant # Date 1678578713 -3600 # Node ID 41be039fbb8c502b7f83fb0dfc6b977dd92ce731 # Parent 8a393ba12cd756330e4cc05543b066e2c6d63277 IDE: fix again ruberband with gtk3. DC logical functions are now disabled when using GTK3. Apparently using XOR was still having an effect. Use regular black pen with no logical funciton instead. diff -r 8a393ba12cd7 -r 41be039fbb8c graphics/RubberBand.py --- a/graphics/RubberBand.py Fri Mar 10 13:00:31 2023 +0100 +++ b/graphics/RubberBand.py Sun Mar 12 00:51:53 2023 +0100 @@ -139,6 +139,11 @@ self.Redraw() + def SetRubberBandPen(self, dc): + # Set DC drawing style + dc.SetPen(wx.Pen(wx.WHITE, style=wx.DOT)) + dc.SetLogicalFunction(wx.XOR) + def DrawBoundingBoxes(self, bboxes, dc=None): """ Draw a list of bounding box on Viewer in the order given using XOR @@ -155,10 +160,9 @@ scalex, scaley = dc.GetUserScale() dc.SetUserScale(1, 1) - # Set DC drawing style - dc.SetPen(wx.Pen(wx.WHITE, style=wx.DOT)) + self.SetRubberBandPen(dc) + dc.SetBrush(wx.TRANSPARENT_BRUSH) - dc.SetLogicalFunction(wx.XOR) # Draw the bounding boxes using viewer scale factor for bbox in bboxes: @@ -214,6 +218,10 @@ RubberBand.Erase = Erase + def SetRubberBandPen(self, dc): + dc.SetPen(wx.Pen(wx.BLACK, style=wx.DOT)) + + RubberBand.SetRubberBandPen = SetRubberBandPen if "gtk3" in wx.PlatformInfo: PatchRubberBandForGTK3()