diff options
author | Walter Bender <walter.bender@gmail.com> | 2013-03-01 21:43:47 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2013-03-01 21:43:47 (GMT) |
commit | 007b1147007a01c242101b467e7bce73b3375bf7 (patch) | |
tree | 64ec37b3fba78905b6ff60c5b5f074de509c466b /TurtleArt | |
parent | ac7a97144d4f700a0ba9e4079eac66d03aab7a46 (diff) |
fix display of turtle coordinates to be more compact
Diffstat (limited to 'TurtleArt')
-rw-r--r-- | TurtleArt/tawindow.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index e842e41..dd3013f 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -2382,6 +2382,7 @@ before making changes to your Turtle Blocks program')) if self.active_turtle is None: self.canvas.set_turtle(self.default_turtle_name) self._coordinate_counter = 0 + self.display_coordinates() return # If we don't have a group of blocks, then there is nothing to do. @@ -3860,17 +3861,19 @@ may not terminate.', False) 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( - formatting % (_('xcor'), x, _('ycor'), y, - _('heading'), h)) + if int(x) == x and int(y) == y and int(h) == h: + formatting = '(%d, %d) %d' + else: + formatting = '(%0.2f, %0.2f) %0.2f' + self.activity.coordinates_label.set_text( + formatting % (x, y, h)) self.activity.coordinates_label.show() elif self.interactive_mode: - formatting = '%s — ' + formatting + if int(x) == x and int(y) == y and int(h) == h: + formatting = '%s — %s: %d %s: %d %s: %d' + else: + formatting = '%s — %s: %0.2f %s: %0.2f %s: %0.2f' self.parent.set_title( formatting % (_('Turtle Art'), _('xcor'), x, _('ycor'), y, _('heading'), h)) |