Fixed some float --> int conversion warnings

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-09-22 22:30:35 +00:00
parent aa22c8def6
commit f00a46313d
3 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ class PyColourSlider(canvas.Canvas):
vstep = 1.0 / self.HEIGHT vstep = 1.0 / self.HEIGHT
for y_pos in range(0, self.HEIGHT): for y_pos in range(0, self.HEIGHT):
r,g,b = [c * 255.0 for c in colorsys.hsv_to_rgb(h,s,v)] r,g,b = [c * 255.0 for c in colorsys.hsv_to_rgb(h,s,v)]
colour = wxColour(int(r), int(g),(b)) colour = wxColour(int(r), int(g), int(b))
self.buffer.SetPen(wxPen(colour, 1, wxSOLID)) self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
self.buffer.DrawRectangle(0, y_pos, 15, 1) self.buffer.DrawRectangle(0, y_pos, 15, 1)
v = v - vstep v = v - vstep

View File

@@ -201,7 +201,7 @@ class PyPalette(canvas.Canvas):
for x in range(0, width, self.HORIZONTAL_STEP): for x in range(0, width, self.HORIZONTAL_STEP):
hue = float(x) / float(width) hue = float(x) / float(width)
r,g,b = colorsys.hsv_to_rgb(hue, saturation, value) r,g,b = colorsys.hsv_to_rgb(hue, saturation, value)
colour = wxColour(r * 255.0, g * 255.0, b * 255.0) colour = wxColour(int(r * 255.0), int(g * 255.0), int(b * 255.0))
self.buffer.SetPen(wxPen(colour, 1, wxSOLID)) self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
self.buffer.SetBrush(wxBrush(colour, wxSOLID)) self.buffer.SetBrush(wxBrush(colour, wxSOLID))
self.buffer.DrawRectangle(x, y, self.buffer.DrawRectangle(x, y,

View File

@@ -40,6 +40,6 @@ def makeGray((r,g,b), factor, maskColor):
changed. changed.
""" """
if (r,g,b) != maskColor: if (r,g,b) != maskColor:
return map(lambda x: ((230 - x) * factor) + x, (r,g,b)) return map(lambda x: int((230 - x) * factor) + x, (r,g,b))
else: else:
return (r,g,b) return (r,g,b)