Even more fixes for silent coercion, which is no more
This commit is contained in:
@@ -212,7 +212,7 @@ class AttributeGauge(wx.Window):
|
||||
for x in range(1, 20):
|
||||
dc.SetBrush(wx.Brush(wx.LIGHT_GREY))
|
||||
dc.SetPen(wx.Pen(wx.LIGHT_GREY))
|
||||
dc.DrawRectangle(round(x * 10), 1, 1, rect.height)
|
||||
dc.DrawRectangle(round(x * 10), 1, 1, round(rect.height))
|
||||
|
||||
dc.SetBrush(wx.Brush(colour))
|
||||
dc.SetPen(wx.Pen(colour))
|
||||
@@ -222,19 +222,19 @@ class AttributeGauge(wx.Window):
|
||||
|
||||
if value >= 0:
|
||||
padding = (half if is_even else math.ceil(half - 1)) + 1
|
||||
dc.DrawRectangle(round(padding), 1, w, rect.height)
|
||||
dc.DrawRectangle(round(padding), 1, round(w), round(rect.height))
|
||||
else:
|
||||
padding = half - w + 1 if is_even else math.ceil(half) - (w - 1)
|
||||
dc.DrawRectangle(round(padding), 1, w, rect.height)
|
||||
dc.DrawRectangle(round(padding), 1, round(w), round(rect.height))
|
||||
|
||||
if self.leading_edge and (self.edge_on_neutral or value != 0):
|
||||
dc.SetPen(wx.Pen(wx.WHITE))
|
||||
dc.SetBrush(wx.Brush(wx.WHITE))
|
||||
|
||||
if value > 0:
|
||||
dc.DrawRectangle(round(min(padding + w, rect.width)), 1, 1, rect.height)
|
||||
dc.DrawRectangle(round(min(padding + w, rect.width)), 1, 1, round(rect.height))
|
||||
else:
|
||||
dc.DrawRectangle(round(max(padding - 1, 1)), 1, 1, rect.height)
|
||||
dc.DrawRectangle(round(max(padding - 1, 1)), 1, 1, round(rect.height))
|
||||
|
||||
def OnTimer(self, event):
|
||||
old_value = self._old_percentage
|
||||
|
||||
@@ -63,4 +63,4 @@ class PFBitmapFrame(wx.Frame):
|
||||
mdc.DrawBitmap(self.bitmap, 0, 0)
|
||||
mdc.SetPen(wx.Pen("#000000", width=1))
|
||||
mdc.SetBrush(wx.TRANSPARENT_BRUSH)
|
||||
mdc.DrawRectangle(0, 0, rect.width, rect.height)
|
||||
mdc.DrawRectangle(0, 0, round(rect.width), round(rect.height))
|
||||
|
||||
@@ -956,7 +956,7 @@ class FittingView(d.Display):
|
||||
cx = padding
|
||||
|
||||
if slotMap[st.slot]:
|
||||
mdc.DrawRectangle(round(cx), round(cy), maxWidth - cx, maxRowHeight)
|
||||
mdc.DrawRectangle(round(cx), round(cy), round(maxWidth - cx), round(maxRowHeight))
|
||||
|
||||
for i, col in enumerate(self.activeColumns):
|
||||
if i > maxColumns:
|
||||
|
||||
@@ -1514,7 +1514,7 @@ class PFNotebookPagePreview(wx.Frame):
|
||||
x, y = mdc.GetTextExtent(self.title)
|
||||
|
||||
mdc.SetBrush(wx.Brush(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)))
|
||||
mdc.DrawRectangle(0, 0, rect.width, 16)
|
||||
mdc.DrawRectangle(0, 0, round(rect.width), 16)
|
||||
|
||||
mdc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
|
||||
|
||||
@@ -1523,4 +1523,4 @@ class PFNotebookPagePreview(wx.Frame):
|
||||
mdc.SetPen(wx.Pen("#000000", width=1))
|
||||
mdc.SetBrush(wx.TRANSPARENT_BRUSH)
|
||||
|
||||
mdc.DrawRectangle(0, 16, rect.width, rect.height - 16)
|
||||
mdc.DrawRectangle(0, 16, round(rect.width), round(rect.height - 16))
|
||||
|
||||
@@ -80,7 +80,7 @@ class LoadAnimation(wx.Window):
|
||||
bh = rect.height
|
||||
y = 0
|
||||
|
||||
dc.DrawRectangle(round(x), round(y), barWidth, bh)
|
||||
dc.DrawRectangle(round(x), round(y), round(barWidth), round(bh))
|
||||
x += barWidth
|
||||
|
||||
textColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
|
||||
|
||||
Reference in New Issue
Block a user