Merge pull request #1055 from RobinD42/fix-issue1013

Fix tickmarks when there is a negative bounds

(cherry picked from commit 24a455acb3)
This commit is contained in:
Robin Dunn
2018-10-26 18:09:32 -07:00
parent cf7995027a
commit b9eb746f40
2 changed files with 8 additions and 3 deletions

View File

@@ -155,6 +155,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