28 , m_dragStart(clicked)
41 const QTransform originalPainterTransform = painter.transform();
70 double ascender = fontMetrics.
ascender;
71 ascender += fontMetrics.
lineGap/2;
72 ascender *= ftMultiplier;
76 bool unwrappedText =
m_modifiers.testFlag(Qt::ControlModifier);
101 QPointF origin = rectangle.topLeft();
108 origin.setY(rectangle.top() + ascender);
110 origin.setX(rectangle.center().x());
112 origin.setX(rectangle.right());
116 origin.setX(rectangle.right() - (lineHeight*0.5));
118 origin.setX(rectangle.left() + (lineHeight*0.5));
122 origin.setY(rectangle.center().y());
124 origin.setY(rectangle.bottom());
128 if (!rectangle.contains(origin) && unwrappedText) {
129 origin = writingMode ==
KoSvgText::HorizontalTB? QPointF(origin.x(), rectangle.bottom()): QPointF(rectangle.center().x(), origin.y());
131 params->
setProperty(
"shapeRect", QVariant(rectangle));
146 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()
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
void setProperty(const QString &name, const QVariant &value)
virtual KoShape * createShape(const KoProperties *params, KoDocumentResourceManager *documentResources=0) const
static KoShapeRegistry * instance()
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.
@ WritingModeId
KoSvgText::WritingMode.
@ DirectionId
KoSvgText::Direction.
@ TextWrapId
KoSvgText::TextWrap.
static const KoSvgTextProperties & defaultProperties()
bool hasProperty(PropertyId id) const
void setProperty(PropertyId id, const QVariant &value)
KoSvgText::FontMetrics metrics(const bool withResolvedLineHeight=true) const
metrics Return the metrics of the first available font.
QVariant propertyOrDefault(PropertyId id) const
KoSvgText::CssLengthPercentage fontSize() const
void inheritFrom(const KoSvgTextProperties &parentProperties, bool resolve=false)
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)
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.