summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2012-11-24 01:10:02 +0100
committerLászló Németh <nemeth@numbertext.org>2012-11-24 01:15:28 +0100
commitf3afa63ef9f4e28c89bf8ee777724ccd1059bd4a (patch)
tree0f8ecd424dd766a0d3f9db24032264101d9233d0
parentd1bfce298bb0414cafcd94cc8cd4694bdc3b4811 (diff)
LibreLogo: fix drawing at the left border, eg. for crop marks
Change-Id: I4798f3575aa90f06c9458ae89d94f72312cf53ab
-rw-r--r--librelogo/source/ChangeLog4
-rw-r--r--librelogo/source/LibreLogo/LibreLogo.py15
2 files changed, 14 insertions, 5 deletions
diff --git a/librelogo/source/ChangeLog b/librelogo/source/ChangeLog
index 17f19a88a998..414c50e4bca4 100644
--- a/librelogo/source/ChangeLog
+++ b/librelogo/source/ChangeLog
@@ -1,3 +1,7 @@
+
+2012-11-24 László Németh:
+ * zero turtle width in hideturtle mode to draw at the left border of the page
+
2012-11-06 László Németh:
* uppercase/translation icon:
- expands and uppercase Logo commands (fd -> FORWARD)
diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index fd33a53ceffe..db697bd7a022 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -12,7 +12,7 @@ import re, random, traceback, itertools
import threading, time as __time__
ctx = uno.getComponentContext()
-__lngpath__ = re.sub("[\w_.]*$", "", ctx.ServiceManager.createInstanceWithContext("org.openoffice.LibreLogo.LibreLogoDummy", ctx).get_path())
+__lngpath__ = re.sub("[\w_.]*$", "", ctx.ServiceManager.createInstanceWithContext("org.openoffice.LibreLogo.LibreLogoDummy", ctx).get_path()) # instead of PackageInformationProvider, see #115393#
__translang__ = "cz|de|dk|en_US|es|fr|hu|it|nl|no|pl|pt|ru|se|sl" # FIXME supported languages for language guessing, expand this list, according to the localizations
__lng__ = {}
__docs__ = {}
@@ -138,6 +138,12 @@ for i in range(32):
__bezierdot__.Coordinates = (tuple(__dots__),)
__bezierdot__.Flags = ((0,) * 32,)
+# turtle shape
+__TURTLESHAPE__ = [((__Point__(-60, 0), __Point__(0, -100), __Point__(60, 0)), (__Point__(0, 0), __Point__(0, 100)), \
+ (__Point__(-250, 0),), (__Point__(0, 250),), (__Point__(250, 0),), (__Point__(0, -250),), # single points for wider selection
+ (__Point__(0, 0),)), # last point for position handling
+ ((__Point__(0, 0),),)] # hidden turtle (single point to draw at the left border of the page area)
+
def __getdocument__():
global __docs__, _
doc = XSCRIPTCONTEXT.getDocument()
@@ -397,9 +403,7 @@ def __initialize__():
shape.TextWrap = __THROUGHT__
shape.Opaque = True
_.drawpage.add(shape)
- shape.PolyPolygon = ((__Point__(-60, 0), __Point__(0, -100), __Point__(60, 0)), (__Point__(0, 0), __Point__(0, 100)), \
- (__Point__(-250, 0),), (__Point__(0, 250),), (__Point__(250, 0),), (__Point__(0, -250),), # single points for wider selection
- (__Point__(0, 0),)) # last point for position handling
+ shape.PolyPolygon = __TURTLESHAPE__[0]
_.shapecache[__TURTLE__] = shape
shape.Name = __TURTLE__
_.initialize()
@@ -461,6 +465,7 @@ def hideturtle():
turtle = __getshape__(__TURTLE__)
if turtle:
__visible__(turtle, False)
+ turtle.PolyPolygon = __TURTLESHAPE__[1]
turtle.LineTransparence, turtle.FillTransparence = 100, 100 # for saved files
__dispatcher__(".uno:Escape")
@@ -472,6 +477,7 @@ def showturtle():
pencolor(_.pencolor)
fillcolor(_.areacolor)
pensize(_.pensize/__PT_TO_TWIP__)
+ turtle.PolyPolygon = __TURTLESHAPE__[0]
__visible__(turtle, True)
_.doc.CurrentController.select(__getshape__(__TURTLE__))
else:
@@ -1308,7 +1314,6 @@ def __compil__(s):
s = re.sub(ur"(?i)\n[ ]*(%s)[ ]+" % __l12n__(_.lng)['TO'], "\n__def__ ", s)
subnames = re.findall(u"(?iu)(?<=__def__ )\w+", s)
globs = ""
-
functions = ["range", "__int__", "__float__", "Random", "Input", "__string__", "len", "round", "abs", "sin", "cos", "sqrt", "set", "list", "tuple", "re.sub", "re.search", "re.findall", "sorted", "min", "max"]
if len(subnames) > 0: