Commit 928458a5 authored by Spencer Bliven's avatar Spencer Bliven

Setting graph background to transparent.

This allows the white background to show through the Graph,
fixing the background problem in #359

@iXce's change in 94d69f79 was on the right track, but
has to occur earlier in the draw cycle.
parent 54fd8798
...@@ -79,8 +79,6 @@ class Graph(BufferedCanvas): ...@@ -79,8 +79,6 @@ class Graph(BufferedCanvas):
#b = gc.CreateLinearGradientBrush(0, 0, w, h, col1, col2) #b = gc.CreateLinearGradientBrush(0, 0, w, h, col1, col2)
gc.SetPen(wx.Pen(wx.Colour(255, 0, 0, 0), 4)) gc.SetPen(wx.Pen(wx.Colour(255, 0, 0, 0), 4))
gc.SetBrush(gc.CreateBrush(wx.Brush(wx.Colour(0, 0, 0, 0))))
gc.DrawRectangle(0, 0, self.width, self.height)
#gc.SetBrush(wx.Brush(wx.Colour(245, 245, 255, 52))) #gc.SetBrush(wx.Brush(wx.Colour(245, 245, 255, 52)))
...@@ -238,6 +236,7 @@ class Graph(BufferedCanvas): ...@@ -238,6 +236,7 @@ class Graph(BufferedCanvas):
self.Refresh() self.Refresh()
def draw(self, dc, w, h): def draw(self, dc, w, h):
dc.SetBackground(wx.Brush(wx.Colour(0,0,0,0)))
dc.Clear() dc.Clear()
gc = wx.GraphicsContext.Create(dc) gc = wx.GraphicsContext.Create(dc)
self.width = w self.width = w
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment