Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_gradient_painter.cc File Reference

Go to the source code of this file.

Classes

class  KisGradientPainter
 
struct  KisGradientPainter::ProcessRegion
 

Functions

KisGradientShapeStrategycreatePolygonShapeStrategy (const QPainterPath &path, const QRect &boundingRect)
 

Function Documentation

◆ createPolygonShapeStrategy()

KisGradientShapeStrategy * createPolygonShapeStrategy ( const QPainterPath & path,
const QRect & boundingRect )

Definition at line 1036 of file kis_gradient_painter.cc.

1037{
1038 // TODO: implement UI for exponent option
1039 const qreal exponent = 2.0;
1040 KisGradientShapeStrategy *strategy =
1041 new KisPolygonalGradientShapeStrategy(path, exponent);
1042
1043 KIS_ASSERT_RECOVER_NOOP(boundingRect.width() >= 3 &&
1044 boundingRect.height() >= 3);
1045
1046 const qreal step =
1047 qMin(qreal(8.0), KritaUtils::maxDimensionPortion(boundingRect, 0.01, 2));
1048
1049 return new KisCachedGradientShapeStrategy(boundingRect, step, step, strategy);
1050}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97
qreal KRITAIMAGE_EXPORT maxDimensionPortion(const QRectF &bounds, qreal portion, qreal minValue)

References KIS_ASSERT_RECOVER_NOOP, and KritaUtils::maxDimensionPortion().