Fix tickmarks when there is a negative bounds

This commit is contained in:
Robin Dunn
2018-10-26 10:38:07 -07:00
parent 73e13bf5f7
commit 776ddbab3d
2 changed files with 8 additions and 3 deletions

View File

@@ -126,6 +126,10 @@ Changes in this release include the following:
* Performance update for `wx.lib.agw.customtreectrl` (#1049)
* Fix drawing of ticks in wx.lib.agw.speedmeter when there are negative bounds
values. (#1013)
4.0.3 "The show must go on. (Die show-stoppers! Die!)"

View File

@@ -971,10 +971,11 @@ class SpeedMeter(BufferedWindow):
for tcount in range(ticknum):
if direction == "Advance":
oldinterval = (oldinterval + spacing) - start
stint = oldinterval
oldinterval = (oldinterval + spacing)
stint = oldinterval - start
else:
oldinterval = start + (oldinterval + spacing)
#oldinterval = start + (oldinterval + spacing)
oldinterval = (oldinterval + spacing)
stint = end - oldinterval
angle = (stint/float(span))*(startangle-endangle) - startangle