From 4d641db4ad2dcad5aa44f82cabb14d237702ac84 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 29 Aug 2013 01:55:46 +0000 Subject: resync with master --- (limited to 'TurtleArt/tasprite_factory.py') diff --git a/TurtleArt/tasprite_factory.py b/TurtleArt/tasprite_factory.py index 200fb78..2bd8993 100755 --- a/TurtleArt/tasprite_factory.py +++ b/TurtleArt/tasprite_factory.py @@ -30,6 +30,20 @@ from taconstants import HIT_RED, HIT_GREEN, HIDE_WHITE, SHOW_WHITE, \ class SVG: + """ Interface to the graphical representation of blocks, turtles, + palettes, etc. on screen + + terms used here: + docks -- list of connection points of a block to other blocks + innies -- right hand side docks of a block, argument slots + outie -- left hand side dock of a block + slot -- top dock of a block that can be attached to other blocks + cap -- top dock of a block that cannot be attached to other blocks + tab -- bottom dock of a block if other blocks can be attached + tail -- bottom dock of a block if no other blocks can be attached + arm -- connection point of a branching block (if-then, loops) where + inner blocks are attached + else -- optional second `arm' for if-then-else blocks """ def __init__(self): self._x = 0 @@ -496,13 +510,13 @@ C 36.1 12.6 43.1 20.6 43.1 30.4 Z" stroke-width="3.5" \ fill="%s" stroke="%s" />\n' % (self._fill, self._stroke) svg += ' \n' % (self._fill, self._stroke) +fill="%s" stroke="none" />\n' % (self._stroke) svg += ' \n' % (self._fill, self._stroke) +stroke-width="3.5" fill="%s" stroke="none" />\n' % (self._stroke) svg += ' \n' % (self._fill, self._stroke) +stroke-width="3.5" fill="%s" stroke="none" />\n' % (self._stroke) svg += ' \n' % (self._stroke) @@ -1224,6 +1238,13 @@ def close_file(f): def generator(datapath): svg = SVG() + f = open_file(datapath, "turtle.svg") + svg.set_scale(2) + svg_str = svg.turtle(['#00FF00','#00AA00']) + f.write(svg_str) + close_file(f) + + svg = SVG() f = open_file(datapath, "boolean_notnot.svg") svg.set_scale(2) svg.expand(30, 0, 0, 0) @@ -1248,7 +1269,6 @@ def generator(datapath): f.write(svg_str) close_file(f) - ''' svg = SVG() f = open_file(datapath, "basic.svg") svg.set_scale(2) @@ -1473,7 +1493,6 @@ def generator(datapath): svg_str = svg.clamp() f.write(svg_str) close_file(f) - ''' def main(): -- cgit v0.9.1