dabo Commit
Revision 7096
Date: 2012-02-16 12:16:42 -0800 (Thu, 16 Feb 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7096
Changed:
U trunk/dabo/lib/reportWriter.py
Log:
Added LineCap property to report writer Line objects, to allow for rounded caps.
Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py 2012-02-13 15:42:49 UTC (rev 7095)
+++ trunk/dabo/lib/reportWriter.py 2012-02-16 20:16:42 UTC (rev 7096)
@@ -1023,6 +1023,12 @@
"""Represents a line."""
def initAvailableProps(self):
super(Line, self).initAvailableProps()
+ self.AvailableProps["LineCap"] = toPropDict(str, "square",
+ """Specifies the cap to use on the ends of the
line.
+
+ Available settings are "square" or "round".
+ """)
+
self.AvailableProps["LineSlant"] = toPropDict(str, "-",
"""Specifies the slant of the line.
@@ -1481,12 +1487,14 @@
for prop in ("strokeWidth", "strokeColor",
"strokeDashArray", ):
props[prop] = obj.getProp(prop)
props["strokeWidth"] = self.getPt(props["strokeWidth"])
-
+ lineCaps = {"square": 0, "round": 1}
+ props["strokeLineCap"] =
lineCaps.get(obj.getProp("lineCap"), 0)
if objType == "SpanningLine":
# Line gets drawn from fixed (x,y) to fixed
(xFooter, yFooter) points.
x = obj["xFrom"]
y = obj["yFrom"]
xFooter, yFooter = origin
+ c.setLineCap(props["lineCap"])
c.setStrokeColorRGB(*props["strokeColor"])
c.setLineWidth(props["strokeWidth"])
c.line(x, y, xFooter, yFooter)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]