summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/graphictools.hxx28
-rw-r--r--vcl/source/gdi/graphictools.cxx11
2 files changed, 39 insertions, 0 deletions
diff --git a/include/vcl/graphictools.hxx b/include/vcl/graphictools.hxx
index 3600f1a364fc..70a17fd9279d 100644
--- a/include/vcl/graphictools.hxx
+++ b/include/vcl/graphictools.hxx
@@ -142,6 +142,34 @@ public:
// mutators
/// Set path to stroke
void setPath ( const Polygon& );
+ /** Set the polygon that is put at the start of the line
+
+ The polygon has to be in a special normalized position, and
+ already scaled to the desired size: the center of the stroked
+ path will meet the given polygon at (0,0) from negative y
+ values. Thus, an arrow would have its baseline on the x axis,
+ going upwards to positive y values. Furthermore, the polygon
+ also has to be scaled appropriately: the width of the joining
+ stroke is defined to be SvtGraphicStroke::normalizedArrowWidth
+ (0x10000), i.e. ranging from x=-0x8000 to x=0x8000. If your
+ arrow does have this width, it will fit every stroke with
+ every stroke width exactly.
+ */
+ void setStartArrow ( const PolyPolygon& );
+ /** Set the polygon that is put at the end of the line
+
+ The polygon has to be in a special normalized position, and
+ already scaled to the desired size: the center of the stroked
+ path will meet the given polygon at (0,0) from negative y
+ values. Thus, an arrow would have its baseline on the x axis,
+ going upwards to positive y values. Furthermore, the polygon
+ also has to be scaled appropriately: the width of the joining
+ stroke is defined to be SvtGraphicStroke::normalizedArrowWidth
+ (0x10000), i.e. ranging from x=-0x8000 to x=0x8000. If your
+ arrow does have this width, it will fit every stroke with
+ every stroke width exactly.
+ */
+ void setEndArrow ( const PolyPolygon& );
/// Affine scaling in both X and Y dimensions
void scale ( double fScaleX, double fScaleY );
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 26cb977846cf..1a0190a4e91b 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -111,6 +111,17 @@ void SvtGraphicStroke::setPath( const Polygon& rPoly )
maPath = rPoly;
}
+void SvtGraphicStroke::setStartArrow( const PolyPolygon& rPoly )
+{
+ maStartArrow = rPoly;
+}
+
+void SvtGraphicStroke::setEndArrow( const PolyPolygon& rPoly )
+{
+ maEndArrow = rPoly;
+}
+
+
void SvtGraphicStroke::scale( double fXScale, double fYScale )
{
// Clearly scaling stroke-width for fat lines is rather a problem