Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--TurtleArt/tacanvas.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 730b50f..6cdac1e 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ ENHANCEMENTS:
* Add busy cursor when projects are being prepared to run
* Reworked Duplicate Blocks warning graphic to reflect current block shapes
* Refactor until block shape to better reflect flow logic
+* Enabled load file to heap/save heap to file to use the Sugar journal
* New translations
BUG FIX:
@@ -17,6 +18,7 @@ BUG FIX:
* Fixed problem with running_blocks flag not being cleared (cause of spurious
"hit stop button" messages.
* Fixed problem with errant text entry widget on run.
+* Fixed problem with text wrap of SVG output #1856 (Jorge Alberto Gómez López)
193
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index 4bac442..f37a3a4 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -305,10 +305,14 @@ class TurtleGraphics:
''' Draw text '''
def _draw_text(cr, label, x, y, size, width, scale, heading, rgb):
+ import textwrap
+ final_scale = int(size * scale) * pango.SCALE
+ label = str(label)
+ label = '\n'.join(textwrap.wrap(label, int(width / scale)))
cc = pangocairo.CairoContext(cr)
pl = cc.create_layout()
fd = pango.FontDescription('Sans')
- fd.set_size(int(size * scale) * pango.SCALE)
+ fd.set_size(final_scale)
pl.set_font_description(fd)
if isinstance(label, (str, unicode)):
pl.set_text(label.replace('\0', ' '))