More fixes for silent coercion, which is no more

This commit is contained in:
DarkPhoenix
2022-04-24 02:19:26 +04:00
parent 17712d8b7d
commit 71d088b90a
3 changed files with 7 additions and 7 deletions

View File

@@ -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(x * 10, 1, 1, rect.height)
dc.DrawRectangle(round(x * 10), 1, 1, 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(padding, 1, w, rect.height)
dc.DrawRectangle(round(padding), 1, w, rect.height)
else:
padding = half - w + 1 if is_even else math.ceil(half) - (w - 1)
dc.DrawRectangle(padding, 1, w, rect.height)
dc.DrawRectangle(round(padding), 1, w, 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(min(padding + w, rect.width), 1, 1, rect.height)
dc.DrawRectangle(round(min(padding + w, rect.width)), 1, 1, rect.height)
else:
dc.DrawRectangle(max(padding - 1, 1), 1, 1, rect.height)
dc.DrawRectangle(round(max(padding - 1, 1)), 1, 1, rect.height)
def OnTimer(self, event):
old_value = self._old_percentage

View File

@@ -956,7 +956,7 @@ class FittingView(d.Display):
cx = padding
if slotMap[st.slot]:
mdc.DrawRectangle(cx, cy, maxWidth - cx, maxRowHeight)
mdc.DrawRectangle(round(cx), round(cy), maxWidth - cx, maxRowHeight)
for i, col in enumerate(self.activeColumns):
if i > maxColumns:

View File

@@ -80,7 +80,7 @@ class LoadAnimation(wx.Window):
bh = rect.height
y = 0
dc.DrawRectangle(x, y, barWidth, bh)
dc.DrawRectangle(round(x), round(y), barWidth, bh)
x += barWidth
textColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)