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

Public Member Functions

KoViewConverterconverter () const
 
bool drawButton (KoSvgTextShape *text)
 
QRectF getButtonRect (QRectF base)
 
QRectF getButtonRectCorrected (QRectF base)
 
KoSvgTextShapegetPotentialTextShape (const QPointF &point)
 
KoSvgTextShapegetTextModeShape ()
 
 Private (KoCanvasBase *canvasBase)
 

Public Attributes

KoCanvasBasecanvas
 
int decorationThickness = 1
 
bool drawBoundingRect = true
 
bool drawOutline = false
 
bool drawTextWrappingArea = false
 
int handleRadius = 7
 
bool textWrappingAreasHovered = false
 

Detailed Description

Definition at line 25 of file KoSvgTextShapeOutlineHelper.cpp.

Constructor & Destructor Documentation

◆ Private()

KoSvgTextShapeOutlineHelper::Private::Private ( KoCanvasBase * canvasBase)
inline

Definition at line 26 of file KoSvgTextShapeOutlineHelper.cpp.

26 : canvas(canvasBase) {
27 }

Member Function Documentation

◆ converter()

KoViewConverter * KoSvgTextShapeOutlineHelper::Private::converter ( ) const
inline

Definition at line 53 of file KoSvgTextShapeOutlineHelper.cpp.

53 {
54 return canvas->viewConverter();
55 }
virtual const KoViewConverter * viewConverter() const =0

References canvas, and KoCanvasBase::viewConverter().

◆ drawButton()

bool KoSvgTextShapeOutlineHelper::Private::drawButton ( KoSvgTextShape * text)
inline

Definition at line 65 of file KoSvgTextShapeOutlineHelper.cpp.

65 {
66 return text && !text->internalShapeManager()->shapes().isEmpty();
67 }
QList< KoShape * > shapes
KoShapeManager * internalShapeManager() const
internalShapeManager

References KoSvgTextShape::internalShapeManager(), and KoShapeManager::shapes.

◆ getButtonRect()

QRectF KoSvgTextShapeOutlineHelper::Private::getButtonRect ( QRectF base)
inline

Definition at line 57 of file KoSvgTextShapeOutlineHelper.cpp.

57 {
59 return QRectF(base.topRight(), QSizeF(buttonSize, buttonSize));
60 }
const int BUTTON_ICON_SIZE
const int BUTTON_PADDING
static int buttonSize(int screen)
Definition KoToolBox.cpp:41

References BUTTON_ICON_SIZE, BUTTON_PADDING, and buttonSize().

◆ getButtonRectCorrected()

QRectF KoSvgTextShapeOutlineHelper::Private::getButtonRectCorrected ( QRectF base)
inline

Definition at line 61 of file KoSvgTextShapeOutlineHelper.cpp.

61 {
62 return converter()->viewToDocument().mapRect(getButtonRect(converter()->documentToView().mapRect(base)));
63 }
virtual QPointF viewToDocument(const QPointF &viewPoint) const

References converter(), getButtonRect(), and KoViewConverter::viewToDocument().

◆ getPotentialTextShape()

KoSvgTextShape * KoSvgTextShapeOutlineHelper::Private::getPotentialTextShape ( const QPointF & point)
inline

Definition at line 41 of file KoSvgTextShapeOutlineHelper.cpp.

41 {
43 KoSvgTextShape *text = dynamic_cast<KoSvgTextShape*>(shape);
44 if (drawButton(text)) {
45 if (getButtonRectCorrected(text->boundingRect()).contains(point)) {
46 return text;
47 }
48 }
49 }
50 return nullptr;
51 }
virtual KoShapeManager * shapeManager() const =0
const QList< KoShape * > selectedEditableShapes() const
KoSelection * selection
QRectF boundingRect() const override
Get the bounding box of the shape.

References KoSvgTextShape::boundingRect(), canvas, drawButton(), getButtonRectCorrected(), KoSelection::selectedEditableShapes(), KoShapeManager::selection, and KoCanvasBase::shapeManager().

◆ getTextModeShape()

KoSvgTextShape * KoSvgTextShapeOutlineHelper::Private::getTextModeShape ( )
inline

Definition at line 37 of file KoSvgTextShapeOutlineHelper.cpp.

37 {
38 return dynamic_cast<KoSvgTextShape*>(canvas->currentShapeManagerOwnerShape());
39 }
virtual KoShape * currentShapeManagerOwnerShape() const
the shape that owns the currently active shape manager

References canvas, and KoCanvasBase::currentShapeManagerOwnerShape().

Member Data Documentation

◆ canvas

KoCanvasBase* KoSvgTextShapeOutlineHelper::Private::canvas

Definition at line 28 of file KoSvgTextShapeOutlineHelper.cpp.

◆ decorationThickness

int KoSvgTextShapeOutlineHelper::Private::decorationThickness = 1

Definition at line 30 of file KoSvgTextShapeOutlineHelper.cpp.

◆ drawBoundingRect

bool KoSvgTextShapeOutlineHelper::Private::drawBoundingRect = true

Definition at line 32 of file KoSvgTextShapeOutlineHelper.cpp.

◆ drawOutline

bool KoSvgTextShapeOutlineHelper::Private::drawOutline = false

Definition at line 34 of file KoSvgTextShapeOutlineHelper.cpp.

◆ drawTextWrappingArea

bool KoSvgTextShapeOutlineHelper::Private::drawTextWrappingArea = false

Definition at line 33 of file KoSvgTextShapeOutlineHelper.cpp.

◆ handleRadius

int KoSvgTextShapeOutlineHelper::Private::handleRadius = 7

Definition at line 29 of file KoSvgTextShapeOutlineHelper.cpp.

◆ textWrappingAreasHovered

bool KoSvgTextShapeOutlineHelper::Private::textWrappingAreasHovered = false

Definition at line 35 of file KoSvgTextShapeOutlineHelper.cpp.


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