Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgGraphicContext.cpp
Go to the documentation of this file.
1
/* This file is part of the KDE project
2
* SPDX-FileCopyrightText: 2003, 2005 Rob Buis <buis@kde.org>
3
* SPDX-FileCopyrightText: 2007, 2009 Jan Hambrecht <jaham@gmx.net>
4
*
5
* SPDX-License-Identifier: LGPL-2.0-or-later
6
*/
7
8
#include "
SvgGraphicContext.h
"
9
10
#include "
kis_pointer_utils.h
"
11
12
13
SvgGraphicsContext::SvgGraphicsContext
()
14
: stroke(
toQShared
(new
KoShapeStroke
()))
15
, textProperties(
KoSvgTextProperties
())
16
{
17
stroke
->setLineStyle(Qt::NoPen,
QVector<qreal>
());
// default is no stroke
18
stroke
->setLineWidth(1.0);
19
stroke
->setCapStyle(Qt::FlatCap);
20
stroke
->setJoinStyle(Qt::MiterJoin);
21
}
22
23
SvgGraphicsContext::SvgGraphicsContext
(
const
SvgGraphicsContext
&gc)
24
: stroke(
toQShared
(new
KoShapeStroke
(*(gc.stroke.data()))))
25
{
26
KoShapeStrokeSP
newStroke =
stroke
;
27
*
this
= gc;
28
this->
stroke
= newStroke;
29
}
30
31
void
SvgGraphicsContext::workaroundClearInheritedFillProperties
()
32
{
42
strokeType
=
None
;
43
44
stroke
=
toQShared
(
new
KoShapeStroke
());
45
stroke
->setLineStyle(Qt::NoPen,
QVector<qreal>
());
// default is no stroke
46
stroke
->setLineWidth(1.0);
47
stroke
->setCapStyle(Qt::FlatCap);
48
stroke
->setJoinStyle(Qt::MiterJoin);
49
50
fillType
=
Solid
;
51
fillRule
= Qt::WindingFill;
52
fillColor
= QColor(Qt::black);
// default is black fill as per svg spec
53
54
opacity
= 1.0;
55
56
currentColor
= Qt::black;
57
}
SvgGraphicContext.h
KoShapeStroke
Definition
KoShapeStroke.cpp:37
KoSvgTextProperties
Definition
KoSvgTextProperties.h:44
QList
Definition
KisQStringListFwd.h:16
QSharedPointer< KoShapeStroke >
SvgGraphicsContext
Definition
SvgGraphicContext.h:17
SvgGraphicsContext::fillRule
Qt::FillRule fillRule
the current fill rule
Definition
SvgGraphicContext.h:33
SvgGraphicsContext::SvgGraphicsContext
SvgGraphicsContext()
Definition
SvgGraphicContext.cpp:13
SvgGraphicsContext::workaroundClearInheritedFillProperties
void workaroundClearInheritedFillProperties()
Definition
SvgGraphicContext.cpp:31
SvgGraphicsContext::strokeType
StyleType strokeType
the current stroke type
Definition
SvgGraphicContext.h:37
SvgGraphicsContext::stroke
KoShapeStrokeSP stroke
the current stroke
Definition
SvgGraphicContext.h:39
SvgGraphicsContext::fillType
StyleType fillType
the current fill type
Definition
SvgGraphicContext.h:32
SvgGraphicsContext::Solid
@ Solid
solid style
Definition
SvgGraphicContext.h:22
SvgGraphicsContext::None
@ None
no style
Definition
SvgGraphicContext.h:21
SvgGraphicsContext::opacity
qreal opacity
the shapes opacity
Definition
SvgGraphicContext.h:45
SvgGraphicsContext::currentColor
QColor currentColor
the current color
Definition
SvgGraphicContext.h:48
SvgGraphicsContext::fillColor
QColor fillColor
the current fill color. Default is black fill as per svg spec
Definition
SvgGraphicContext.h:34
kis_pointer_utils.h
toQShared
QSharedPointer< T > toQShared(T *ptr)
Definition
kis_pointer_utils.h:19
libs
flake
svg
SvgGraphicContext.cpp
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52