Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-08-26 14:38:06 (GMT)
committer Walter Bender <walter@sugarlabs.org>2013-08-26 14:38:06 (GMT)
commit624c945534e6a4d1a30d1c6fcfc621b3b27995ab (patch)
treeb36d8a541538ddd88d70aa914928f585a0ecf262
parentc8e6fa6779197d644c170f37941a5a25842876dc (diff)
more fine-tuning of the rescaling parameters
-rw-r--r--NEWS3
-rw-r--r--TurtleArt/tawindow.py22
-rwxr-xr-xturtleblocks.py8
3 files changed, 26 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 27c0bf9..bf3360e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
188
+ENHANCEMENT:
+* Add labels to Cartesian coordinate grid
+
BUG FIXES:
* Ensure that default coordinate scale is 1 (pixel mode)
* Adjust pen size to coordinate scale
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index c58bbae..50691c8 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -568,7 +568,8 @@ class TurtleArtWindow():
if self.running_sugar:
scale = self.height / 800.
else:
- scale = (self.height + ICON_SIZE) / 800.
+ scale = self.height / 800.
+ # scale = (self.height + ICON_SIZE) / 800.
self.overlay_shapes['Cartesian'] = Sprite(
self.sprite_list,
int(self.width / 2 - 600),
@@ -740,7 +741,8 @@ class TurtleArtWindow():
if self.running_sugar:
y_offset = 0
else:
- y_offset = ICON_SIZE
+ y_offset = 0
+ # y_offset = ICON_SIZE
self.canvas.draw_surface(
self.overlay_shapes[overlay].cached_surfaces[0],
(self.canvas.width - width) / 2.0,
@@ -748,10 +750,13 @@ class TurtleArtWindow():
width,
height)
- def update_overlay_position(self, widget, event):
+ def update_overlay_position(self, widget=None, event=None):
''' Reposition the overlays when window size changes '''
- self.width = event.width
- self.height = event.height
+ # self.width = event.width
+ # self.height = event.height
+ self.width = gtk.gdk.screen_width()
+ self.height = gtk.gdk.screen_height()
+
for name in OVERLAY_SHAPES:
if not name in self.overlay_shapes:
continue
@@ -760,17 +765,24 @@ class TurtleArtWindow():
if shape in shape._sprites.list:
shape.hide()
showing = True
+ self.overlay_shapes[name].move((int(self.width / 2 - 600),
+ int(self.height / 2 - 450)))
+ '''
self.overlay_shapes[name] = Sprite(
self.sprite_list,
int(self.width / 2 - 600),
int(self.height / 2 - 450),
svg_str_to_pixbuf(
svg_from_file('%s/images/%s.svg' % (self.path, name))))
+ '''
if showing:
self.overlay_shapes[name].set_layer(OVERLAY_LAYER)
else:
self.overlay_shapes[name].hide()
+ '''
self.overlay_shapes[name].type = 'overlay'
+ '''
+
self.cartesian = False
self.polar = False
self.metric = False
diff --git a/turtleblocks.py b/turtleblocks.py
index b3997db..b6e9fd6 100755
--- a/turtleblocks.py
+++ b/turtleblocks.py
@@ -220,8 +220,11 @@ return %s(self)" % (p, P, P)
cr = cairo.Context(img_surface)
surface = cr.get_target()
self.turtle_canvas = surface.create_similar(
- cairo.CONTENT_COLOR, max(1024, gtk.gdk.screen_width() * 2),
- max(768, gtk.gdk.screen_height() * 2))
+ cairo.CONTENT_COLOR,
+ # max(1024, gtk.gdk.screen_width() * 2),
+ # max(768, gtk.gdk.screen_height() * 2))
+ gtk.gdk.screen_width() * 2,
+ gtk.gdk.screen_height() * 2)
self.tw = TurtleArtWindow(self.canvas, self._execdirname,
turtle_canvas=self.turtle_canvas,
activity=self, running_sugar=False)
@@ -577,6 +580,7 @@ Would you like to save before quitting?'))
return
if self.tw.coord_scale == 1:
self.tw.coord_scale = self.tw.height / 40
+ self.tw.update_overlay_position()
if self.tw.cartesian is True:
self.tw.overlay_shapes['Cartesian_labeled'].hide()
self.tw.overlay_shapes['Cartesian'].set_layer(OVERLAY_LAYER)