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)
 
KoColorDisplayRendererInterfacerenderInterface ()
 

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 26 of file KoSvgTextShapeOutlineHelper.cpp.

Constructor & Destructor Documentation

◆ Private()

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

Definition at line 27 of file KoSvgTextShapeOutlineHelper.cpp.

27 : canvas(canvasBase) {
28 }

Member Function Documentation

◆ converter()

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

Definition at line 54 of file KoSvgTextShapeOutlineHelper.cpp.

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

References canvas, and KoCanvasBase::viewConverter().

◆ drawButton()

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

Definition at line 66 of file KoSvgTextShapeOutlineHelper.cpp.

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

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

◆ getButtonRect()

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

Definition at line 58 of file KoSvgTextShapeOutlineHelper.cpp.

58 {
60 return QRectF(base.topRight(), QSizeF(buttonSize, buttonSize));
61 }
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 62 of file KoSvgTextShapeOutlineHelper.cpp.

62 {
63 return converter()->viewToDocument().mapRect(getButtonRect(converter()->documentToView().mapRect(base)));
64 }
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 42 of file KoSvgTextShapeOutlineHelper.cpp.

42 {
44 KoSvgTextShape *text = dynamic_cast<KoSvgTextShape*>(shape);
45 if (drawButton(text)) {
46 if (getButtonRectCorrected(text->boundingRect()).contains(point)) {
47 return text;
48 }
49 }
50 }
51 return nullptr;
52 }
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 38 of file KoSvgTextShapeOutlineHelper.cpp.

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

References canvas, and KoCanvasBase::currentShapeManagerOwnerShape().

◆ renderInterface()

KoColorDisplayRendererInterface * KoSvgTextShapeOutlineHelper::Private::renderInterface ( )
inline

Definition at line 70 of file KoSvgTextShapeOutlineHelper.cpp.

70 {
72 }
virtual KoColorDisplayRendererInterface * displayRendererInterface() const
displayRendererInterface The display renderer interface has a number of color conversion functions wh...

References canvas, and KoCanvasBase::displayRendererInterface().

Member Data Documentation

◆ canvas

KoCanvasBase* KoSvgTextShapeOutlineHelper::Private::canvas

Definition at line 29 of file KoSvgTextShapeOutlineHelper.cpp.

◆ decorationThickness

int KoSvgTextShapeOutlineHelper::Private::decorationThickness = 1

Definition at line 31 of file KoSvgTextShapeOutlineHelper.cpp.

◆ drawBoundingRect

bool KoSvgTextShapeOutlineHelper::Private::drawBoundingRect = true

Definition at line 33 of file KoSvgTextShapeOutlineHelper.cpp.

◆ drawOutline

bool KoSvgTextShapeOutlineHelper::Private::drawOutline = false

Definition at line 35 of file KoSvgTextShapeOutlineHelper.cpp.

◆ drawTextWrappingArea

bool KoSvgTextShapeOutlineHelper::Private::drawTextWrappingArea = false

Definition at line 34 of file KoSvgTextShapeOutlineHelper.cpp.

◆ handleRadius

int KoSvgTextShapeOutlineHelper::Private::handleRadius = 7

Definition at line 30 of file KoSvgTextShapeOutlineHelper.cpp.

◆ textWrappingAreasHovered

bool KoSvgTextShapeOutlineHelper::Private::textWrappingAreasHovered = false

Definition at line 36 of file KoSvgTextShapeOutlineHelper.cpp.


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