Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-11-12 17:16:27 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-11-12 17:16:27 (GMT)
commit6e9a1c8c55bc1124b93dc60265e1f1e04d7a893b (patch)
treecd2caeb290050a07795aa4877e12d7cbcfd416fa /TurtleArt
parent5beecd45a4920f3da45d6b8c45e5ba869f5b4f6e (diff)
cscott got the pixel order backwards
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/sprites.py15
-rw-r--r--TurtleArt/tacanvas.py2
2 files changed, 3 insertions, 14 deletions
diff --git a/TurtleArt/sprites.py b/TurtleArt/sprites.py
index 412e3bd..baae94f 100644
--- a/TurtleArt/sprites.py
+++ b/TurtleArt/sprites.py
@@ -450,16 +450,5 @@ class Sprite:
cs.flush() # ensure all writing is done
# Read the pixel
pixels = cs.get_data()
- return (ord(pixels[0]), ord(pixels[1]), ord(pixels[2]), 0)
- '''
- # Map the cairo surface onto a pixmap
- pixmap = gtk.gdk.Pixmap(None, self.rect.width, self.rect.height, 24)
- cr = pixmap.cairo_create()
- cr.set_source_surface(self.cached_surfaces[i], 0, 0)
- cr.paint()
- # Read the pixel
- pixel = pixmap.get_image(x, y, 1, 1).get_pixel(0, 0)
- return(int((pixel & 0xFF0000) >> 16),
- int((pixel & 0x00FF00) >> 8),
- int((pixel & 0x0000FF) >> 0), 0)
- '''
+ return (ord(pixels[2]), ord(pixels[1]), ord(pixels[0]), 0)
+
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index 49f0e8a..43e5ad2 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -719,7 +719,7 @@ class TurtleGraphics:
cs.flush() # ensure all writing is done
# Read the pixel
pixels = cs.get_data()
- return (ord(pixels[0]), ord(pixels[1]), ord(pixels[2]), 0)
+ return (ord(pixels[2]), ord(pixels[1]), ord(pixels[0]), 0)
else:
return(-1, -1, -1, -1)