Changeset View
Changeset View
Standalone View
Standalone View
commands/tools/kpToolFloodFillCommand.cpp
Show All 40 Lines | |||||
41 | 41 | | |||
42 | #include <KLocalizedString> | 42 | #include <KLocalizedString> | ||
43 | 43 | | |||
44 | //--------------------------------------------------------------------- | 44 | //--------------------------------------------------------------------- | ||
45 | 45 | | |||
46 | struct kpToolFloodFillCommandPrivate | 46 | struct kpToolFloodFillCommandPrivate | ||
47 | { | 47 | { | ||
48 | kpImage oldImage; | 48 | kpImage oldImage; | ||
49 | bool fillEntireImage; | 49 | bool fillEntireImage{false}; | ||
50 | }; | 50 | }; | ||
51 | 51 | | |||
52 | //--------------------------------------------------------------------- | 52 | //--------------------------------------------------------------------- | ||
53 | 53 | | |||
54 | kpToolFloodFillCommand::kpToolFloodFillCommand (int x, int y, | 54 | kpToolFloodFillCommand::kpToolFloodFillCommand (int x, int y, | ||
55 | const kpColor &color, int processedColorSimilarity, | 55 | const kpColor &color, int processedColorSimilarity, | ||
56 | kpCommandEnvironment *environ) | 56 | kpCommandEnvironment *environ) | ||
57 | 57 | | |||
Show All 36 Lines | |||||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | //--------------------------------------------------------------------- | 96 | //--------------------------------------------------------------------- | ||
97 | 97 | | |||
98 | // protected virtual [base kpCommand] | 98 | // protected virtual [base kpCommand] | ||
99 | void kpToolFloodFillCommand::execute () | 99 | void kpToolFloodFillCommand::execute () | ||
100 | { | 100 | { | ||
101 | qCDebug(kpLogCommands) << "kpToolFloodFillCommand::execute() fillEntireImage=" | 101 | qCDebug(kpLogCommands) << "kpToolFloodFillCommand::execute() fillEntireImage=" | ||
102 | << d->fillEntireImage << endl; | 102 | << d->fillEntireImage; | ||
103 | 103 | | |||
104 | kpDocument *doc = document (); | 104 | kpDocument *doc = document (); | ||
105 | Q_ASSERT (doc); | 105 | Q_ASSERT (doc); | ||
106 | 106 | | |||
107 | 107 | | |||
108 | if (d->fillEntireImage) | 108 | if (d->fillEntireImage) | ||
109 | { | 109 | { | ||
110 | doc->fill (kpFloodFill::color ()); | 110 | doc->fill (kpFloodFill::color ()); | ||
Show All 20 Lines | |||||
131 | } | 131 | } | ||
132 | 132 | | |||
133 | //--------------------------------------------------------------------- | 133 | //--------------------------------------------------------------------- | ||
134 | 134 | | |||
135 | // protected virtual [base kpCommand] | 135 | // protected virtual [base kpCommand] | ||
136 | void kpToolFloodFillCommand::unexecute () | 136 | void kpToolFloodFillCommand::unexecute () | ||
137 | { | 137 | { | ||
138 | qCDebug(kpLogCommands) << "kpToolFloodFillCommand::unexecute() fillEntireImage=" | 138 | qCDebug(kpLogCommands) << "kpToolFloodFillCommand::unexecute() fillEntireImage=" | ||
139 | << d->fillEntireImage << endl; | 139 | << d->fillEntireImage; | ||
140 | 140 | | |||
141 | kpDocument *doc = document (); | 141 | kpDocument *doc = document (); | ||
142 | Q_ASSERT (doc); | 142 | Q_ASSERT (doc); | ||
143 | 143 | | |||
144 | 144 | | |||
145 | if (d->fillEntireImage) | 145 | if (d->fillEntireImage) | ||
146 | { | 146 | { | ||
147 | doc->fill (kpFloodFill::colorToChange ()); | 147 | doc->fill (kpFloodFill::colorToChange ()); | ||
Show All 16 Lines |