36 , m_dragStart(clicked)
50 const QTransform originalPainterTransform = painter.transform();
79 double ascender = fontMetrics.
ascender;
80 ascender += fontMetrics.
lineGap/2;
81 ascender *= ftMultiplier;
113 QPointF origin = rectangle.topLeft();
120 origin.setY(rectangle.top() + ascender);
122 origin.setX(rectangle.center().x());
124 origin.setX(rectangle.right());
128 origin.setX(rectangle.right() - (lineHeight*0.5));
130 origin.setX(rectangle.left() + (lineHeight*0.5));
134 origin.setY(rectangle.center().y());
136 origin.setY(rectangle.bottom());
140 if (!rectangle.contains(origin) && unwrappedText) {
141 origin = writingMode ==
KoSvgText::HorizontalTB? QPointF(origin.x(), rectangle.bottom()): QPointF(rectangle.center().x(), origin.y());
143 params->
setProperty(
"shapeRect", QVariant(rectangle));
178 const qreal grab =
tool->grabSensitivityInPt();
179 QList<KoPathSegment> segments = path->segmentsAt(path->outlineRect().adjusted(-grab, -grab, grab, grab));
207 return parentCommand;
void setText(const KUndo2MagicString &text)
KUndo2MagicString text() const
The KisHandlePainterHelper class is a special helper for painting handles around objects....
void setHandleStyle(const KisHandleStyle &style)
void drawRubberLine(const QPolygonF &poly)
static KisHandleStyle & primarySelection()
KoSelectedShapesProxy * selectedShapesProxy()
selectedShapesProxy
QPointer< KoShapeController > shapeController
virtual void updateCanvas(const QRectF &rc)=0
virtual KoSelectedShapesProxy * selectedShapesProxy() const =0
selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged...
const T value(const QString &id) const
KoToolBase * tool() const
uint decorationThickness() const
A KoPathSegment consist of two neighboring KoPathPoints.
qreal length(qreal error=0.005) const
qreal nearestPoint(const QPointF &point) const
bool isValid() const
Returns if segment is valid, e.g. has two valid points.
The position of a path point within a path shape.
void setProperty(const QString &name, const QVariant &value)
The KoSelectedShapesProxy class is a special interface of KoCanvasBase to have a stable connection to...
virtual KoShape * createShape(const KoProperties *params, KoDocumentResourceManager *documentResources=0) const
static KoShapeRegistry * instance()
QPointF absolutePosition(KoFlake::AnchorPosition anchor=KoFlake::Center) const
virtual void setPosition(const QPointF &position)
Set the position of the shape in pt.
void reset()
Resets the snap guide.
QPointF snap(const QPointF &mousePosition, Qt::KeyboardModifiers modifiers)
snaps the mouse position, returns if mouse was snapped
@ TextAnchorId
KoSvgText::TextAnchor.
@ InlineSizeId
KoSvgText::AutoValue.
@ TextOrientationId
KoSvgText::TextOrientation.
@ TextCollapseId
KoSvgText::TextSpaceCollapse.
@ StrokeId
KoSvgText::StrokeProperty.
@ FillId
KoSvgText::BackgroundProperty.
@ WritingModeId
KoSvgText::WritingMode.
@ DirectionId
KoSvgText::Direction.
@ TextWrapId
KoSvgText::TextWrap.
QSharedPointer< KoShapeBackground > background() const
void removeProperty(PropertyId id)
KoShapeStrokeModelSP stroke() const
KoSvgText::FontMetrics metrics(const bool withResolvedLineHeight=true, const bool offsetByBaseline=false) const
metrics Return the metrics of the first available font.
static const KoSvgTextProperties & defaultProperties()
bool hasProperty(PropertyId id) const
void inheritFrom(const KoSvgTextProperties &parentProperties, bool resolve=false, bool onlyFontAndLineHeight=false)
void setProperty(PropertyId id, const QVariant &value)
QVariant propertyOrDefault(PropertyId id) const
KoSvgText::CssLengthPercentage fontSize() const
void setBackground(QSharedPointer< KoShapeBackground > background) override
int posForIndex(int index, bool firstIndex=false, bool skipSynthetic=false) const
posForIndex Get the cursor position for a given index in a string.
void setStroke(KoShapeStrokeModelSP stroke) override
virtual QPointF documentToView(const QPointF &documentPoint) const
bool draggingInlineSize()
void handleMouseMove(const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override
KUndo2Command * createCommand() override
void cancelInteraction() override
Qt::KeyboardModifiers m_modifiers
void finishInteraction(Qt::KeyboardModifiers modifiers) override
SvgCreateTextStrategy(SvgTextTool *tool, const QPointF &clicked, KoShape *shape=nullptr)
void paint(QPainter &painter, const KoViewConverter &converter) override
T kisGrowRect(const T &rect, U offset)
TextAnchor
Where the text is anchored for SVG 1.1 text and 'inline-size'.
@ AnchorEnd
Anchor right for LTR, left for RTL.
@ AnchorStart
Anchor left for LTR, right for RTL.
@ AnchorMiddle
Anchor to the middle.
Direction
Base direction used by Bidi algorithm.
@ OrientationUpright
Set all characters upright.
@ Preserve
Do not collapse any space.
The FontMetrics class A class to keep track of a variety of font metrics. Note that values are in Fre...
qint32 lineGap
additional linegap between consecutive lines.
qint32 fontSize
Currently set size, CSS unit 'em'.
qint32 descender
distance for origin to bottom.
qint32 ascender
distance from origin to top.