Kaydet (Commit) 3617e1a3 authored tarafından László Németh's avatar László Németh

librelogo: more invisible settings (on UI, hatching), see ChangeLog

Change-Id: Icb0d195ba82b023d370847242b4e3b5546fa0320
üst 55d4d0a7
helpcontent2 @ 0d8b37cd
Subproject commit 91f8b3cb54e752a174ee10be4e528c7dcd4fb55e Subproject commit 0d8b37cd9e0b89d1136b09a81671c88fc91fee3e
2013-10-24 László Németh:
* synchronize Writer/Draw when saving cropped SVG to avoid program halt,
huge sleeps (the workaround) have been removed
* support hatching with 'INVISIBLE' filling color
* support PENUP in UI (Line Style "-none-")
* support INVISIBLE filling color in UI (Area Style/Filling "None")
* using 'INVISIBLE' line and filling colors set -none-/None in
Drawing Object Properties toolbar
* fix blinking LABEL (now the temporary text shape is invisible)
* support PENCAP settings (values: NONE, ROUND, SQUARE)
* fix black (not refreshed) invisible filling color (LO 4.1 problem)
reported by Levente Kovács in http://bug.openscope.org/browse/OOO-838
2013-08-29 László Németh: 2013-08-29 László Németh:
* fix bad selection of invisible turtle after HIDETURTLE CLEARSCREEN * fix bad selection of invisible turtle after HIDETURTLE CLEARSCREEN
* fix SVG cropping in LibreOffice 4.1 * fix SVG cropping in LibreOffice 4.1
......
...@@ -112,6 +112,8 @@ from com.sun.star.drawing.LineJoint import NONE as __Joint_NONE__ ...@@ -112,6 +112,8 @@ from com.sun.star.drawing.LineJoint import NONE as __Joint_NONE__
from com.sun.star.drawing.LineJoint import BEVEL as __BEVEL__ from com.sun.star.drawing.LineJoint import BEVEL as __BEVEL__
from com.sun.star.drawing.LineJoint import MITER as __MITER__ from com.sun.star.drawing.LineJoint import MITER as __MITER__
from com.sun.star.drawing.LineJoint import ROUND as __ROUNDED__ from com.sun.star.drawing.LineJoint import ROUND as __ROUNDED__
from com.sun.star.drawing.FillStyle import NONE as __FillStyle_NONE__
from com.sun.star.drawing.LineStyle import NONE as __LineStyle_NONE__
from com.sun.star.drawing.LineStyle import SOLID as __LineStyle_SOLID__ from com.sun.star.drawing.LineStyle import SOLID as __LineStyle_SOLID__
from com.sun.star.drawing.LineStyle import DASH as __LineStyle_DASHED__ from com.sun.star.drawing.LineStyle import DASH as __LineStyle_DASHED__
from com.sun.star.drawing.DashStyle import RECT as __DashStyle_RECT__ from com.sun.star.drawing.DashStyle import RECT as __DashStyle_RECT__
...@@ -463,10 +465,18 @@ def __initialize__(): ...@@ -463,10 +465,18 @@ def __initialize__():
shape.FillColor, transparence = __splitcolor__(_.areacolor) shape.FillColor, transparence = __splitcolor__(_.areacolor)
shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor) shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor)
elif shape.Visible: elif shape.Visible:
_.areacolor = shape.FillColor + (int(255.0 * shape.FillTransparence/100) << 24) if shape.FillStyle == __FillStyle_NONE__:
_.pencolor = shape.LineColor + (int(255.0 * shape.LineTransparence/100) << 24) _.areacolor = 0xffffffff
else:
_.areacolor = shape.FillColor + (int(255.0 * shape.FillTransparence/100) << 24)
if shape.LineWidth != round((1 + _.pen * 2) * __PT_TO_TWIP__ / __MM10_TO_TWIP__) and shape.LineWidth != round(__LINEWIDTH__ / __MM10_TO_TWIP__): if shape.LineWidth != round((1 + _.pen * 2) * __PT_TO_TWIP__ / __MM10_TO_TWIP__) and shape.LineWidth != round(__LINEWIDTH__ / __MM10_TO_TWIP__):
_.pensize = shape.LineWidth * __MM10_TO_TWIP__ _.pensize = shape.LineWidth * __MM10_TO_TWIP__
if shape.LineStyle == __LineStyle_NONE__: # - none -
__pen__(0)
else:
if shape.LineStyle == __LineStyle_SOLID__:
__pen__(1)
_.pencolor = shape.LineColor + (int(255.0 * shape.LineTransparence/100) << 24)
shape.LineJoint = __ROUNDED__ shape.LineJoint = __ROUNDED__
shape.Shadow = True shape.Shadow = True
shape.FillColor, transparence = __splitcolor__(_.areacolor) shape.FillColor, transparence = __splitcolor__(_.areacolor)
...@@ -886,6 +896,8 @@ def __go__(shapename, n, dot = False, preciseAngle = -1): ...@@ -886,6 +896,8 @@ def __go__(shapename, n, dot = False, preciseAngle = -1):
shape.PolyPolygon = tuple([tuple( list(shape.PolyPolygon[-1]) + [last2])]) shape.PolyPolygon = tuple([tuple( list(shape.PolyPolygon[-1]) + [last2])])
shape.LineWidth = _.pensize / __MM10_TO_TWIP__ shape.LineWidth = _.pensize / __MM10_TO_TWIP__
shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor) shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor)
if shape.LineTransparence == 100:
shape.LineStyle = 0
__visible__(shape, True) __visible__(shape, True)
shape.Name = __ACTUAL__ shape.Name = __ACTUAL__
_.shapecache[__ACTUAL__] = shape _.shapecache[__ACTUAL__] = shape
...@@ -909,15 +921,21 @@ def __fillit__(filled = True): ...@@ -909,15 +921,21 @@ def __fillit__(filled = True):
shape.LineStyle, shape.LineDash = __linestyle__(_.linestyle) shape.LineStyle, shape.LineDash = __linestyle__(_.linestyle)
shape.LineJoint = _.linejoint shape.LineJoint = _.linejoint
shape.LineCap = _.linecap shape.LineCap = _.linecap
shape.LineWidth = _.pensize / __MM10_TO_TWIP__
shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor)
shape.FillColor, shape.FillTransparence = __splitcolor__(_.areacolor)
if _.hatch: if _.hatch:
shape.FillBackground = True shape.FillBackground = True if shape.FillTransparence != 100 else False
shape.FillHatch = _.hatch shape.FillHatch = _.hatch
shape.FillStyle = 3 shape.FillStyle = 3
else: else:
shape.FillStyle = int(filled) shape.FillStyle = int(filled)
shape.LineWidth = _.pensize / __MM10_TO_TWIP__ if shape.LineTransparence == 100:
shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor) shape.LineStyle = 0
shape.FillColor, shape.FillTransparence = __splitcolor__(_.areacolor) if shape.FillTransparence == 100:
shape.FillTransparence = 0 # for hatching and better modifications on UI
if not _.hatch:
shape.FillStyle = 0
shape.setString(oldshape.getString()) shape.setString(oldshape.getString())
oldshape.Name = "" oldshape.Name = ""
shape.Name = __ACTUAL__ shape.Name = __ACTUAL__
...@@ -949,12 +967,6 @@ def point(): ...@@ -949,12 +967,6 @@ def point():
def __boxshape__(shapetype, l): def __boxshape__(shapetype, l):
turtle = __getshape__(__TURTLE__) turtle = __getshape__(__TURTLE__)
shape = __draw__(shapetype + "Shape") shape = __draw__(shapetype + "Shape")
if _.hatch:
shape.FillBackground = True
shape.FillHatch = _.hatch
shape.FillStyle = 3
else:
shape.FillStyle = 1
pos = turtle.getPosition() pos = turtle.getPosition()
pos.X = pos.X - (l[0] * __PT_TO_TWIP__ / __MM10_TO_TWIP__ / 2) + turtle.BoundRect.Width / 2.0 pos.X = pos.X - (l[0] * __PT_TO_TWIP__ / __MM10_TO_TWIP__ / 2) + turtle.BoundRect.Width / 2.0
pos.Y = pos.Y - (l[1] * __PT_TO_TWIP__ / __MM10_TO_TWIP__ / 2) + turtle.BoundRect.Height / 2.0 pos.Y = pos.Y - (l[1] * __PT_TO_TWIP__ / __MM10_TO_TWIP__ / 2) + turtle.BoundRect.Height / 2.0
...@@ -966,6 +978,18 @@ def __boxshape__(shapetype, l): ...@@ -966,6 +978,18 @@ def __boxshape__(shapetype, l):
shape.LineCap = _.linecap shape.LineCap = _.linecap
shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor) shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor)
shape.FillColor, shape.FillTransparence = __splitcolor__(_.areacolor) shape.FillColor, shape.FillTransparence = __splitcolor__(_.areacolor)
if _.hatch:
shape.FillBackground = True if shape.FillTransparence != 100 else False
shape.FillHatch = _.hatch
shape.FillStyle = 3
else:
shape.FillStyle = 1
if shape.LineTransparence == 100:
shape.LineStyle = 0
if shape.FillTransparence == 100:
shape.FillTransparence = 0 # for hatching and better modifications on UI
if not _.hatch:
shape.FillStyle = 0
shape.RotateAngle = turtle.RotateAngle shape.RotateAngle = turtle.RotateAngle
if shapetype == "Rectangle" and len(l) > 2: if shapetype == "Rectangle" and len(l) > 2:
shape.CornerRadius = (l[2] * __PT_TO_TWIP__) / __MM10_TO_TWIP__ shape.CornerRadius = (l[2] * __PT_TO_TWIP__) / __MM10_TO_TWIP__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment