Commit 9e6ee547 authored by Blackbeard (alberto flores)'s avatar Blackbeard (alberto flores) 🚢

Add appropriate brushType

parent 75365412
......@@ -27,7 +27,7 @@
KisVectorShapeObject::KisVectorShapeObject(KoShape* shape)
{
m_shape = shape;
renderImage(1000, 1000);
renderImage(20, 20);
}
void KisVectorShapeObject::setShape(KoShape* shape)
......@@ -57,19 +57,23 @@ void KisVectorShapeObject::renderImage(int width, int height)
theImage = theImage.convertToFormat(QImage::Format_Indexed8, table);
setBrushTipImage(theImage);
m_image = theImage;
// m_image = theImage;
}
QImage KisVectorShapeObject::image()
enumBrushType KisVectorShapeObject::brushType() const
{
return brushTipImage();
return IMAGE;
}
QImage KisVectorShapeObject::brushTipImage() const
{
return m_image;
}
//QImage KisVectorShapeObject::image()
//{
// return brushTipImage();
//}
//QImage KisVectorShapeObject::brushTipImage() const
//{
// return m_image;
//}
......@@ -86,7 +90,6 @@ KoShape* KisVectorShapeObject::shape()
}
KisBrush* KisVectorShapeObject::clone() const
{
return new KisVectorShapeObject(*this);
......
......@@ -64,12 +64,14 @@ public:
/**
* @return a preview of the brush
*/
QImage brushTipImage() const override;
// QImage brushTipImage() const override;
QImage image();
// QImage image();
KoShape* shape();
void renderImage(int width, int weight);
enumBrushType brushType() const override;
private:
......
......@@ -97,7 +97,7 @@ KisVectorAnimatedBrush::KisVectorAnimatedBrush(const QString& filename)
: KisScalingSizeBrush(filename)
, m_d(new Private())
{
setBrushType(PIPE_MASK);
setBrushType(PIPE_IMAGE);
setSpacing(1.0);
setHasColor(false);
......@@ -116,6 +116,11 @@ KisVectorAnimatedBrush::~KisVectorAnimatedBrush()
delete m_d;
}
enumBrushType KisVectorAnimatedBrush::brushType() const
{
return PIPE_IMAGE;
}
KisBrush* KisVectorAnimatedBrush::clone() const
{
return new KisVectorAnimatedBrush(*this);
......@@ -274,7 +279,7 @@ void KisVectorAnimatedBrush::newbrushTip()
setValid(true);
setBrushType(MASK);
setBrushType(IMAGE);
setHasColor(false);
setWidth(brushTipImage().width());
......
......@@ -65,6 +65,7 @@ public:
// QImage brushTipImage() const override;
enumBrushType brushType() const override;
// Asks for the new image
......
......@@ -82,7 +82,7 @@ QImage KisVectorBrushParasite::shapeToQImage(QList<KoShape *> shapes, int index)
KoShapePainter painter;
painter.setShapes(single_list);
QImage theImage(1000, 1000, QImage::Format_ARGB32); //fix size
QImage theImage(20, 20, QImage::Format_ARGB32); //fix size
{
QPainter p(&theImage);
p.fillRect(0, 0, theImage.width(), theImage.height(), Qt::white);
......@@ -94,6 +94,7 @@ QImage KisVectorBrushParasite::shapeToQImage(QList<KoShape *> shapes, int index)
for (int i = 0; i < 256; ++i) table.push_back(qRgb(i, i, i));
theImage = theImage.convertToFormat(QImage::Format_Indexed8, table);
return theImage;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment