Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/svg/SvgGraphicContext.cpp
Show All 18 Lines | |||||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "SvgGraphicContext.h" | 21 | #include "SvgGraphicContext.h" | ||
22 | 22 | | |||
23 | #include "kis_pointer_utils.h" | 23 | #include "kis_pointer_utils.h" | ||
24 | 24 | | |||
25 | 25 | | |||
26 | SvgGraphicsContext::SvgGraphicsContext() | 26 | SvgGraphicsContext::SvgGraphicsContext() | ||
27 | : stroke(toQShared(new KoShapeStroke())) | ||||
28 | , textProperties(KoSvgTextProperties::defaultProperties()) | ||||
27 | { | 29 | { | ||
28 | strokeType = None; | | |||
29 | | ||||
30 | stroke = toQShared(new KoShapeStroke()); | | |||
31 | stroke->setLineStyle(Qt::NoPen, QVector<qreal>()); // default is no stroke | 30 | stroke->setLineStyle(Qt::NoPen, QVector<qreal>()); // default is no stroke | ||
32 | stroke->setLineWidth(1.0); | 31 | stroke->setLineWidth(1.0); | ||
33 | stroke->setCapStyle(Qt::FlatCap); | 32 | stroke->setCapStyle(Qt::FlatCap); | ||
34 | stroke->setJoinStyle(Qt::MiterJoin); | 33 | stroke->setJoinStyle(Qt::MiterJoin); | ||
35 | | ||||
36 | fillType = Solid; | | |||
37 | fillRule = Qt::WindingFill; | | |||
38 | fillColor = QColor(Qt::black); // default is black fill as per svg spec | | |||
39 | | ||||
40 | opacity = 1.0; | | |||
41 | | ||||
42 | currentColor = Qt::black; | | |||
43 | forcePercentage = false; | | |||
44 | | ||||
45 | display = true; | | |||
46 | visible = true; | | |||
47 | isResolutionFrame = false; | | |||
48 | | ||||
49 | clipRule = Qt::WindingFill; | | |||
50 | preserveWhitespace = false; | | |||
51 | | ||||
52 | pixelsPerInch = 72.0; | | |||
53 | forcedFontSizeCoeff = 1.0; // no workaround by default | | |||
54 | | ||||
55 | autoFillMarkers = false; | | |||
56 | textProperties = KoSvgTextProperties::defaultProperties(); | | |||
57 | } | 34 | } | ||
58 | 35 | | |||
59 | void SvgGraphicsContext::workaroundClearInheritedFillProperties() | 36 | void SvgGraphicsContext::workaroundClearInheritedFillProperties() | ||
60 | { | 37 | { | ||
61 | /** | 38 | /** | ||
62 | * HACK ALERT: according to SVG patterns, clip paths and clip masks | 39 | * HACK ALERT: according to SVG patterns, clip paths and clip masks | ||
63 | * must not inherit any properties from the referencing element. | 40 | * must not inherit any properties from the referencing element. | ||
64 | * We still don't support it, therefore we reset only fill/stroke | 41 | * We still don't support it, therefore we reset only fill/stroke | ||
Show All 21 Lines |