Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Blackbeard (alberto flores)
Krita
Commits
0b2ef645
Commit
0b2ef645
authored
Aug 20, 2019
by
Blackbeard (alberto flores)
🚢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit from KisScalingsizebrush in KisVectorShapeObject
parent
dfc52d7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
11 deletions
+36
-11
libs/brush/KisVectorShapeObject.cpp
libs/brush/KisVectorShapeObject.cpp
+25
-1
libs/brush/KisVectorShapeObject.h
libs/brush/KisVectorShapeObject.h
+5
-0
libs/brush/kis_vectoranimated_brush.cpp
libs/brush/kis_vectoranimated_brush.cpp
+5
-9
libs/brush/kis_vectoranimated_brush.h
libs/brush/kis_vectoranimated_brush.h
+1
-1
No files found.
libs/brush/KisVectorShapeObject.cpp
View file @
0b2ef645
...
...
@@ -24,6 +24,25 @@
#include <KoXmlReader.h>
#include <KoShapePainter.h>
#define DEFAULT_SPACING 5.0
KisVectorShapeObject
::
KisVectorShapeObject
(
const
QString
&
filename
)
:
KisScalingSizeBrush
(
filename
)
{
setBrushType
(
MASK
);
setHasColor
(
false
);
setSpacing
(
DEFAULT_SPACING
);
}
KisVectorShapeObject
::
KisVectorShapeObject
(
const
KisVectorShapeObject
&
rhs
)
:
KisScalingSizeBrush
(
rhs
)
,
m_shape
(
rhs
.
m_shape
)
,
m_image
(
rhs
.
m_image
)
{
}
KisVectorShapeObject
::
KisVectorShapeObject
(
KoShape
*
shape
)
{
m_shape
=
shape
;
...
...
@@ -56,13 +75,18 @@ void KisVectorShapeObject::renderImage(int width, int height)
for
(
int
i
=
0
;
i
<
256
;
++
i
)
table
.
push_back
(
qRgb
(
i
,
i
,
i
));
theImage
=
theImage
.
convertToFormat
(
QImage
::
Format_Indexed8
,
table
);
setValid
(
true
);
setBrushType
(
MASK
);
setHasColor
(
false
);
setBrushTipImage
(
theImage
);
// m_image = theImage;
}
enumBrushType
KisVectorShapeObject
::
brushType
()
const
{
return
I
MA
GE
;
return
MA
SK
;
}
//QImage KisVectorShapeObject::image()
...
...
libs/brush/KisVectorShapeObject.h
View file @
0b2ef645
...
...
@@ -37,7 +37,12 @@ class BRUSH_EXPORT KisVectorShapeObject : public KisScalingSizeBrush
protected:
public:
/// Construct brush to load filename later as brush
KisVectorShapeObject
(
const
QString
&
filename
);
KisVectorShapeObject
(
KoShape
*
shape
);
KisVectorShapeObject
(
const
KisVectorShapeObject
&
rhs
);
/**
...
...
libs/brush/kis_vectoranimated_brush.cpp
View file @
0b2ef645
...
...
@@ -94,17 +94,16 @@ public:
};
KisVectorAnimatedBrush
::
KisVectorAnimatedBrush
(
const
QString
&
filename
)
:
Kis
ScalingSizeBrush
(
filename
)
:
Kis
VectorShapeObject
(
filename
)
,
m_d
(
new
Private
())
{
setBrushType
(
PIPE_
I
MA
GE
);
setSpacing
(
1
.0
);
setBrushType
(
PIPE_MA
SK
);
setSpacing
(
5
.0
);
setHasColor
(
false
);
}
KisVectorAnimatedBrush
::
KisVectorAnimatedBrush
(
const
KisVectorAnimatedBrush
&
rhs
)
:
Kis
ScalingSizeBrush
(
rhs
)
:
Kis
VectorShapeObject
(
rhs
)
,
m_d
(
new
Private
(
*
rhs
.
m_d
))
,
m_svg
(
rhs
.
m_svg
)
{
...
...
@@ -168,17 +167,14 @@ bool KisVectorAnimatedBrush::loadFromDevice(QIODevice *dev)
}
// KisVectorShapeObject currentVectorObject = m_vectorObjects.at(m_parasite.index());
// QImage tip = currentVectorObject.image();
// for(int i = 0; i<m_shapes.count(); i++)
// {
// KisVectorShapeObject* brush = new KisVectorShapeObject(name() + '_' + QString().setNum(i),
// m_vectorObjects.at(m_parasite.)
// }
// // setBrushTipImage(tip);
setBrushTipImage
(
m_d
->
brushesPipe
.
firstBrush
()
->
brushTipImage
());
setValid
(
true
);
...
...
libs/brush/kis_vectoranimated_brush.h
View file @
0b2ef645
...
...
@@ -34,7 +34,7 @@
//
class
BRUSH_EXPORT
KisVectorAnimatedBrush
:
public
Kis
ScalingSizeBrush
class
BRUSH_EXPORT
KisVectorAnimatedBrush
:
public
Kis
VectorShapeObject
{
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment