Fix gauge bars
This commit is contained in:
@@ -254,7 +254,6 @@ class PyGauge(wx.Window):
|
||||
w = rect.width
|
||||
else:
|
||||
w = rect.width * (float(value) / 100)
|
||||
|
||||
r = copy.copy(rect)
|
||||
r.width = w
|
||||
dc.DrawRectangle(r)
|
||||
@@ -315,7 +314,8 @@ class PyGauge(wx.Window):
|
||||
color,
|
||||
gradient_color
|
||||
)
|
||||
dc.DrawBitmap(gradient_bitmap, r.left, r.top)
|
||||
if gradient_bitmap is not None:
|
||||
dc.DrawBitmap(gradient_bitmap, r.left, r.top)
|
||||
|
||||
# font stuff begins here
|
||||
dc.SetFont(self.font)
|
||||
|
||||
@@ -35,6 +35,8 @@ def DrawFilledBitmap(width, height, color):
|
||||
|
||||
|
||||
def DrawGradientBar(width, height, gStart, gEnd, gMid=None, fillRatio=4):
|
||||
if width == 0 or height == 0:
|
||||
return None
|
||||
canvas = wx.Bitmap(width, height)
|
||||
|
||||
mdc = wx.MemoryDC()
|
||||
|
||||
Reference in New Issue
Block a user