mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
Don't try to compare Colours.
If any two elements of self._value are equal, sorted tries to sort by the next element in the zipped tuples, resulting in TypeError: '<' not supported between instances of 'Colour' and 'Colour' Specifying a key to sort only by the first element prevents this.
This commit is contained in:
@@ -505,12 +505,12 @@ class PyGauge(wx.Window):
|
||||
""" Internal method which sorts things so we draw the longest bar first. """
|
||||
|
||||
if self.GetBarGradient():
|
||||
tmp = sorted(zip(self._value,self._barGradient)); tmp.reverse()
|
||||
tmp = sorted(zip(self._value,self._barGradient), key=lambda x: x[0]); tmp.reverse()
|
||||
a, b = list(zip(*tmp))
|
||||
self._valueSorted = list(a)
|
||||
self._barGradientSorted = list(b)
|
||||
else:
|
||||
tmp = sorted(zip(self._value,self._barColour)); tmp.reverse()
|
||||
tmp = sorted(zip(self._value,self._barColour), key=lambda x: x[0]); tmp.reverse()
|
||||
a, b = list(zip(*tmp))
|
||||
self._valueSorted = list(a)
|
||||
self._barColourSorted = list(b)
|
||||
|
||||
Reference in New Issue
Block a user