Krita Source Code Documentation
Loading...
Searching...
No Matches
ShapeStrokeFillFetchPolicy Struct Reference

Public Types

typedef KoShapeStrokeModelSP PointerType
 
typedef KoFlake::FillType Type
 

Static Public Member Functions

static QColor color (KoShape *shape)
 
static bool compareTo (PointerType p1, PointerType p2)
 
static PointerType getBackground (KoShape *shape)
 
static const QGradient * gradient (KoShape *shape)
 
static QTransform gradientTransform (KoShape *shape)
 
static Type type (KoShape *shape)
 

Detailed Description

Definition at line 92 of file KoShapeFillWrapper.cpp.

Member Typedef Documentation

◆ PointerType

◆ Type

Member Function Documentation

◆ color()

static QColor ShapeStrokeFillFetchPolicy::color ( KoShape * shape)
inlinestatic

Definition at line 118 of file KoShapeFillWrapper.cpp.

118 {
119 KoShapeStrokeSP stroke = qSharedPointerDynamicCast<KoShapeStroke>(shape->stroke());
120 return stroke ? stroke->color() : QColor();
121 }
virtual KoShapeStrokeModelSP stroke() const
Definition KoShape.cpp:1067

References KoShape::stroke().

◆ compareTo()

static bool ShapeStrokeFillFetchPolicy::compareTo ( PointerType p1,
PointerType p2 )
inlinestatic

Definition at line 133 of file KoShapeFillWrapper.cpp.

133 {
134 return p1->compareFillTo(p2.data());
135 }
QPointF p2
QPointF p1

References p1, and p2.

◆ getBackground()

static PointerType ShapeStrokeFillFetchPolicy::getBackground ( KoShape * shape)
inlinestatic

Definition at line 97 of file KoShapeFillWrapper.cpp.

97 {
98 return shape->stroke();
99 }

References KoShape::stroke().

◆ gradient()

static const QGradient * ShapeStrokeFillFetchPolicy::gradient ( KoShape * shape)
inlinestatic

Definition at line 123 of file KoShapeFillWrapper.cpp.

123 {
124 KoShapeStrokeSP stroke = qSharedPointerDynamicCast<KoShapeStroke>(shape->stroke());
125 return stroke ? stroke->lineBrush().gradient() : 0;
126 }

References KoShape::stroke().

◆ gradientTransform()

static QTransform ShapeStrokeFillFetchPolicy::gradientTransform ( KoShape * shape)
inlinestatic

Definition at line 128 of file KoShapeFillWrapper.cpp.

128 {
129 KoShapeStrokeSP stroke = qSharedPointerDynamicCast<KoShapeStroke>(shape->stroke());
130 return stroke ? stroke->lineBrush().transform() : QTransform();
131 }

References KoShape::stroke().

◆ type()

static Type ShapeStrokeFillFetchPolicy::type ( KoShape * shape)
inlinestatic

Definition at line 100 of file KoShapeFillWrapper.cpp.

100 {
101 KoShapeStrokeSP stroke = qSharedPointerDynamicCast<KoShapeStroke>(shape->stroke());
102 if (!stroke) return Type::None;
103
104 // Pattern type not implemented yet, so that logic will have to be added here later
105 if (stroke->lineBrush().gradient()) {
106 return Type::Gradient;
107 } else {
108
109 // strokes without any width are none
110 if (stroke->color().isValid() && stroke->lineWidth() != 0.0) {
111 return Type::Solid;
112 }
113
114 return Type::None;
115 }
116 }

References KoShape::stroke().


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