Address FutureWarning about implicit float to int conversions
This commit is contained in:
parent
7199a4f4ce
commit
6ed8a405fe
@ -921,7 +921,7 @@ class AxisItem(GraphicsWidget):
|
|||||||
p2[axis] += tickLength*tickDir
|
p2[axis] += tickLength*tickDir
|
||||||
tickPen = self.pen()
|
tickPen = self.pen()
|
||||||
color = tickPen.color()
|
color = tickPen.color()
|
||||||
color.setAlpha(lineAlpha)
|
color.setAlpha(int(lineAlpha))
|
||||||
tickPen.setColor(color)
|
tickPen.setColor(color)
|
||||||
tickSpecs.append((tickPen, Point(p1), Point(p2)))
|
tickSpecs.append((tickPen, Point(p1), Point(p2)))
|
||||||
profiler('compute ticks')
|
profiler('compute ticks')
|
||||||
@ -1078,7 +1078,7 @@ class AxisItem(GraphicsWidget):
|
|||||||
p.setFont(self.tickFont)
|
p.setFont(self.tickFont)
|
||||||
p.setPen(self.textPen())
|
p.setPen(self.textPen())
|
||||||
for rect, flags, text in textSpecs:
|
for rect, flags, text in textSpecs:
|
||||||
p.drawText(rect, flags, text)
|
p.drawText(rect, flags.__int__(), text)
|
||||||
|
|
||||||
profiler('draw text')
|
profiler('draw text')
|
||||||
|
|
||||||
|
@ -654,7 +654,7 @@ class GradientEditorItem(TickSliderItem):
|
|||||||
s = s1 * (1.-f) + s2 * f
|
s = s1 * (1.-f) + s2 * f
|
||||||
v = v1 * (1.-f) + v2 * f
|
v = v1 * (1.-f) + v2 * f
|
||||||
c = QtGui.QColor()
|
c = QtGui.QColor()
|
||||||
c.setHsv(h,s,v)
|
c.setHsv(*map(int, [h,s,v]))
|
||||||
if toQColor:
|
if toQColor:
|
||||||
return c
|
return c
|
||||||
else:
|
else:
|
||||||
|
@ -153,7 +153,7 @@ class GridItem(UIGraphicsItem):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
ppl = dim[ax] / nl[ax]
|
ppl = dim[ax] / nl[ax]
|
||||||
c = np.clip(5.*(ppl-3), 0., 50.)
|
c = np.clip(5 * (ppl-3), 0., 50.).astype(int)
|
||||||
|
|
||||||
linePen = self.opts['pen']
|
linePen = self.opts['pen']
|
||||||
lineColor = self.opts['pen'].color()
|
lineColor = self.opts['pen'].color()
|
||||||
|
Loading…
Reference in New Issue
Block a user