Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeGroupCommandPrivate Class Reference

Public Member Functions

QRectF containerBoundingRect ()
 
 KoShapeGroupCommandPrivate (KoShapeContainer *container, const QList< KoShape * > &shapes, bool _shouldNormalize)
 

Public Attributes

KoShapeContainercontainer
 the container where the grouping should be for.
 
QList< KoShapeContainer * > oldParents
 the old parents of the shapes
 
QList< KoShape * > shapes
 list of shapes to be grouped
 
QScopedPointer< KUndo2CommandshapesReorderCommand
 
bool shouldNormalize
 Adjust the coordinate system of the group to its origin into the topleft of the group.
 

Detailed Description

Definition at line 30 of file KoShapeGroupCommand.cpp.

Constructor & Destructor Documentation

◆ KoShapeGroupCommandPrivate()

KoShapeGroupCommandPrivate::KoShapeGroupCommandPrivate ( KoShapeContainer * container,
const QList< KoShape * > & shapes,
bool _shouldNormalize )

Definition at line 44 of file KoShapeGroupCommand.cpp.

45 : shapes(s),
46 shouldNormalize(_shouldNormalize),
47 container(c)
48{
49 std::stable_sort(shapes.begin(), shapes.end(), KoShape::compareShapeZIndex);
50}
KoShapeContainer * container
the container where the grouping should be for.
bool shouldNormalize
Adjust the coordinate system of the group to its origin into the topleft of the group.
QList< KoShape * > shapes
list of shapes to be grouped
static bool compareShapeZIndex(KoShape *s1, KoShape *s2)
Definition KoShape.cpp:434

References KoShape::compareShapeZIndex(), and shapes.

Member Function Documentation

◆ containerBoundingRect()

QRectF KoShapeGroupCommandPrivate::containerBoundingRect ( )

Definition at line 182 of file KoShapeGroupCommand.cpp.

183{
184 QRectF bound;
185 if (container->shapeCount() > 0) {
187 }
188
189 Q_FOREACH (KoShape *shape, shapes) {
190 bound |= shape->absoluteTransformation().mapRect(shape->outlineRect());
191 }
192
193 return bound;
194}
virtual QRectF outlineRect() const
Definition KoShape.cpp:637
QTransform absoluteTransformation() const
Definition KoShape.cpp:382

References KoShape::absoluteTransformation(), container, KoShape::outlineRect(), KoShapeContainer::shapeCount(), and shapes.

Member Data Documentation

◆ container

KoShapeContainer* KoShapeGroupCommandPrivate::container

the container where the grouping should be for.

Definition at line 38 of file KoShapeGroupCommand.cpp.

◆ oldParents

QList<KoShapeContainer*> KoShapeGroupCommandPrivate::oldParents

the old parents of the shapes

Definition at line 39 of file KoShapeGroupCommand.cpp.

◆ shapes

QList<KoShape*> KoShapeGroupCommandPrivate::shapes

list of shapes to be grouped

Definition at line 36 of file KoShapeGroupCommand.cpp.

◆ shapesReorderCommand

QScopedPointer<KUndo2Command> KoShapeGroupCommandPrivate::shapesReorderCommand

Definition at line 41 of file KoShapeGroupCommand.cpp.

◆ shouldNormalize

bool KoShapeGroupCommandPrivate::shouldNormalize

Adjust the coordinate system of the group to its origin into the topleft of the group.

Definition at line 37 of file KoShapeGroupCommand.cpp.


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