Shipbrowser -> drawUtils -> eye-candy stuff for DrawGradientBar (added a fill ratio)
This commit is contained in:
@@ -35,17 +35,20 @@ def DrawFilledBitmap(width, height, color):
|
||||
def DrawGradientBar(width, height, gStart, gEnd, gMid = None):
|
||||
canvas = wx.EmptyBitmap(width,height)
|
||||
|
||||
fillRatio = 6
|
||||
mdc = wx.MemoryDC()
|
||||
mdc.SelectObject(canvas)
|
||||
|
||||
r = wx.Rect(0, 0, width, height)
|
||||
r.height = r.height / 2
|
||||
r.height = height / fillRatio
|
||||
|
||||
if gMid is None:
|
||||
gMid = gStart
|
||||
|
||||
mdc.GradientFillLinear(r, gStart, gEnd, wx.SOUTH)
|
||||
r.top = r.height
|
||||
r.height = height * (fillRatio - 1)/fillRatio + (1 if height % fillRatio != 0 else 0)
|
||||
|
||||
mdc.GradientFillLinear(r, gMid, gEnd, wx.NORTH)
|
||||
|
||||
mdc.SelectObject(wx.NullBitmap)
|
||||
|
||||
Reference in New Issue
Block a user