Kaydet (Commit) d7cebf0f authored tarafından Caolán McNamara's avatar Caolán McNamara

restore SvtGraphicStroke::set[Start|End]Arrow

partial revert of 743e627b
because we want to use that then unused code now

Change-Id: I94fe173dda053ce1b72b3b776a9855ce9ecc249b
üst 96204ecf
...@@ -142,6 +142,34 @@ public: ...@@ -142,6 +142,34 @@ public:
// mutators // mutators
/// Set path to stroke /// Set path to stroke
void setPath ( const Polygon& ); 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 /// Affine scaling in both X and Y dimensions
void scale ( double fScaleX, double fScaleY ); void scale ( double fScaleX, double fScaleY );
......
...@@ -111,6 +111,17 @@ void SvtGraphicStroke::setPath( const Polygon& rPoly ) ...@@ -111,6 +111,17 @@ void SvtGraphicStroke::setPath( const Polygon& rPoly )
maPath = 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 ) void SvtGraphicStroke::scale( double fXScale, double fYScale )
{ {
// Clearly scaling stroke-width for fat lines is rather a problem // Clearly scaling stroke-width for fat lines is rather a problem
......
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