Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgTextOnPathDecorationHelper::Private Struct Reference

Public Member Functions

QLineF getLineAnchorTextNode (KoSvgTextNodeIndex &index, qreal lineLength)
 

Public Attributes

qreal decorationThickness = 1
 
qreal handleRadius = 7
 
bool isActive = false
 
bool isHovered = false
 
int pos = 0
 
KoSvgTextShapeshape = nullptr
 

Detailed Description

Definition at line 13 of file SvgTextOnPathDecorationHelper.cpp.

Member Function Documentation

◆ getLineAnchorTextNode()

QLineF SvgTextOnPathDecorationHelper::Private::getLineAnchorTextNode ( KoSvgTextNodeIndex & index,
qreal lineLength )
inline

Definition at line 23 of file SvgTextOnPathDecorationHelper.cpp.

23 {
24 KoPathShape *s = dynamic_cast<KoPathShape*>(index.textPath());
25 QPainterPath outline = s->transformation().map(s->outline());
26 QLineF line;
28 outline = outline.toReversed();
29 }
30 qreal percent = index.textPathInfo()->startOffsetIsPercentage?
31 outline.percentAtLength(index.textPathInfo()->startOffset * 0.01 * outline.length()):
32 outline.percentAtLength(index.textPathInfo()->startOffset);
33 if (s->isClosedSubpath(s->subpathCount()-1)) {
34 percent = fmod(percent, 1.0);
35 } else {
36 percent = qBound(0.0, percent, 1.0);
37 }
38 line.setP1(outline.pointAtPercent(percent));
39 line.setAngle(outline.angleAtPercent(percent) - 90);
40 line.setLength(lineLength);
41 return line;
42 }
The position of a path point within a path shape.
Definition KoPathShape.h:63
bool isClosedSubpath(int subpathIndex) const
Checks if a subpath is closed.
QPainterPath outline() const override
reimplemented
int subpathCount() const
Returns the number of subpaths in the path.
QTransform transformation() const
Returns the shapes local transformation matrix.
Definition KoShape.cpp:383
KoShape * textPath()
textPath
KoSvgText::TextOnPathInfo * textPathInfo()
textPathInfo the text path info for this node as a pointer.
@ TextPathSideRight
Definition KoSvgText.h:301

References KoPathShape::isClosedSubpath(), KoPathShape::outline(), KoSvgText::TextOnPathInfo::side, KoSvgText::TextOnPathInfo::startOffset, KoSvgText::TextOnPathInfo::startOffsetIsPercentage, KoPathShape::subpathCount(), KoSvgTextNodeIndex::textPath(), KoSvgTextNodeIndex::textPathInfo(), KoSvgText::TextPathSideRight, and KoShape::transformation().

Member Data Documentation

◆ decorationThickness

qreal SvgTextOnPathDecorationHelper::Private::decorationThickness = 1

Definition at line 18 of file SvgTextOnPathDecorationHelper.cpp.

◆ handleRadius

qreal SvgTextOnPathDecorationHelper::Private::handleRadius = 7

Definition at line 17 of file SvgTextOnPathDecorationHelper.cpp.

◆ isActive

bool SvgTextOnPathDecorationHelper::Private::isActive = false

Definition at line 21 of file SvgTextOnPathDecorationHelper.cpp.

◆ isHovered

bool SvgTextOnPathDecorationHelper::Private::isHovered = false

Definition at line 20 of file SvgTextOnPathDecorationHelper.cpp.

◆ pos

int SvgTextOnPathDecorationHelper::Private::pos = 0

Definition at line 15 of file SvgTextOnPathDecorationHelper.cpp.

◆ shape

KoSvgTextShape* SvgTextOnPathDecorationHelper::Private::shape = nullptr

Definition at line 14 of file SvgTextOnPathDecorationHelper.cpp.


The documentation for this struct was generated from the following file: