Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Office
Calligra
Commits
516abf27
Commit
516abf27
authored
Jul 21, 2011
by
Sven Langkamp
Browse files
set the simple mode for brush outlines
CCBUG:273904
parent
1a14585e
Changes
3
Hide whitespace changes
Inline
Side-by-side
krita/image/kis_outline_generator.cpp
View file @
516abf27
...
...
@@ -27,7 +27,7 @@
#include <KoColorSpace.h>
KisOutlineGenerator
::
KisOutlineGenerator
(
const
KoColorSpace
*
cs
,
quint8
defaultOpacity
)
:
m_cs
(
cs
),
m_defaultOpacity
(
defaultOpacity
)
:
m_cs
(
cs
),
m_defaultOpacity
(
defaultOpacity
)
,
m_simple
(
false
)
{
}
...
...
@@ -60,8 +60,7 @@ QVector<QPolygon> KisOutlineGenerator::outline(quint8* buffer, qint32 xOffset, q
QPolygon
path
;
path
<<
QPoint
(
x
+
xOffset
,
y
+
yOffset
);
// XXX: Unused? (BSAR)
// bool clockwise = edge == BottomEdge;
bool
clockwise
=
edge
==
BottomEdge
;
qint32
row
=
y
,
col
=
x
;
EdgeType
currentEdge
=
edge
;
...
...
@@ -78,7 +77,8 @@ QVector<QPolygon> KisOutlineGenerator::outline(quint8* buffer, qint32 xOffset, q
nextOutlineEdge
(
&
currentEdge
,
&
row
,
&
col
,
buffer
,
width
,
height
);
}
while
(
row
!=
y
||
col
!=
x
||
currentEdge
!=
edge
);
paths
.
push_back
(
path
);
if
(
!
m_simple
||
!
clockwise
)
paths
.
push_back
(
path
);
}
}
}
...
...
@@ -176,3 +176,8 @@ void KisOutlineGenerator::appendCoordinate(QPolygon * path, int x, int y, EdgeTy
}
*
path
<<
QPoint
(
x
,
y
);
}
void
KisOutlineGenerator
::
setSimpleOutline
(
bool
simple
)
{
m_simple
=
simple
;
}
krita/image/kis_outline_generator.h
View file @
516abf27
...
...
@@ -55,7 +55,13 @@ public:
* @returns list of polygons around every non-transparent area
**/
QVector
<
QPolygon
>
outline
(
quint8
*
buffer
,
qint32
xOffset
,
qint32
yOffset
,
qint32
width
,
qint32
height
);
/**
* Set the generator to produce simpile outline, skipping outline that are fully enclosed
* @param simple set simple mode, if true enclosed outline will be skipped
**/
void
setSimpleOutline
(
bool
simple
);
private:
enum
EdgeType
{
...
...
@@ -74,6 +80,7 @@ private:
const
KoColorSpace
*
m_cs
;
quint8
m_defaultOpacity
;
bool
m_simple
;
};
#endif // KIS_OUTLINE_GENERATOR_H
krita/plugins/paintops/libbrush/kis_boundary.cc
View file @
516abf27
...
...
@@ -46,6 +46,7 @@ void KisBoundary::generateBoundary()
return
;
KisOutlineGenerator
generator
(
d
->
m_device
->
colorSpace
(),
OPACITY_TRANSPARENT_U8
);
generator
.
setSimpleOutline
(
true
);
d
->
m_boundary
=
generator
.
outline
(
d
->
m_device
->
data
(),
0
,
0
,
d
->
m_device
->
bounds
().
width
(),
d
->
m_device
->
bounds
().
height
());
d
->
path
=
QPainterPath
();
...
...
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