Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgSelectTextStrategy.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
7#include "SvgTextCursor.h"
8#include <QDebug>
9
10SvgSelectTextStrategy::SvgSelectTextStrategy(KoToolBase *tool, SvgTextCursor *cursor, const QPointF &clicked, Qt::KeyboardModifiers modifiers)
12 , m_cursor(cursor)
13 , m_dragStart(clicked)
14{
16 m_cursor->setPosToPoint(m_dragStart, !(modifiers & Qt::ShiftModifier));
17}
18
19void SvgSelectTextStrategy::handleMouseMove(const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers)
20{
21 Q_UNUSED(modifiers)
22 m_dragEnd = mouseLocation;
23 if (!(modifiers & Qt::ShiftModifier)) {
25 }
27}
28
33
38
39void SvgSelectTextStrategy::finishInteraction(Qt::KeyboardModifiers modifiers)
40{
41 Q_UNUSED(modifiers)
42 if (!(modifiers & Qt::ShiftModifier)) {
44 }
46
47}
void finishInteraction(Qt::KeyboardModifiers modifiers) override
SvgSelectTextStrategy(KoToolBase *tool, SvgTextCursor *cursor, const QPointF &clicked, Qt::KeyboardModifiers modifiers)
void handleMouseMove(const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override
KUndo2Command * createCommand() override
The SvgTextCursor class.
void setPosToPoint(QPointF point, bool moveAnchor=true)
Set the pos from a point. This currently does a search inside the text shape.