Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-11-01 14:15:57 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-11-01 14:15:57 (GMT)
commitd9057fb5f52221f537be52f31df19783403a6b76 (patch)
treea4d67158f1539f65955a9a0f9f6ef08db1374145 /TurtleArt/tawindow.py
parent0f1d1747978c7c9c230b8f6bb13b72f787f15acb (diff)
more consistent formating of coordinate display
Diffstat (limited to 'TurtleArt/tawindow.py')
-rw-r--r--TurtleArt/tawindow.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 1d1b62c..4ec98b0 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -3752,16 +3752,20 @@ class TurtleArtWindow():
x = round_int(float(self.canvas.xcor) / self.coord_scale)
y = round_int(float(self.canvas.ycor) / self.coord_scale)
h = round_int(self.canvas.heading)
+ if int(x) == x and int(y) == y and int(h) == h:
+ formatting = '%s: %d %s: %d %s: %d'
+ else:
+ formatting = '%s: %0.2f %s: %0.2f %s: %0.2f'
if self.running_sugar:
self.activity.coordinates_label.set_text(
- "%s: %d %s: %d %s: %d" % (_("xcor"), x, _("ycor"), y,
- _("heading"), h))
+ formatting % (_('xcor'), x, _('ycor'), y,
+ _('heading'), h))
self.activity.coordinates_label.show()
elif self.interactive_mode:
self.parent.set_title(
- "%s — %s: %d %s: %d %s: %d" % (
- _("Turtle Art"), _("xcor"), x, _("ycor"), y,
- _("heading"), h))
+ '%s — ' + formatting % (
+ _('Turtle Art'), _('xcor'), x, _('ycor'), y,
+ _('heading'), h))
def showlabel(self, shp, label=''):
''' Display a message on a status block '''