Changeset View
Changeset View
Standalone View
Standalone View
plugins/tools/basictools/kis_tool_line.cc
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 166 | if(mode() == KisTool::PAINT_MODE) { | |||
---|---|---|---|---|---|
167 | paintLine(gc,QRect()); | 167 | paintLine(gc,QRect()); | ||
168 | } | 168 | } | ||
169 | KisToolPaint::paint(gc,converter); | 169 | KisToolPaint::paint(gc,converter); | ||
170 | } | 170 | } | ||
171 | 171 | | |||
172 | void KisToolLine::beginPrimaryAction(KoPointerEvent *event) | 172 | void KisToolLine::beginPrimaryAction(KoPointerEvent *event) | ||
173 | { | 173 | { | ||
174 | NodePaintAbility nodeAbility = nodePaintAbility(); | 174 | NodePaintAbility nodeAbility = nodePaintAbility(); | ||
175 | if (nodeAbility == NONE || !nodeEditable()) { | 175 | if (nodeAbility == UNPAINTABLE || !nodeEditable()) { | ||
176 | event->ignore(); | 176 | event->ignore(); | ||
177 | return; | 177 | return; | ||
178 | } | 178 | } | ||
179 | 179 | | |||
180 | setMode(KisTool::PAINT_MODE); | 180 | setMode(KisTool::PAINT_MODE); | ||
181 | 181 | | |||
182 | const KisToolShape::ShapeAddInfo info = | 182 | const KisToolShape::ShapeAddInfo info = | ||
183 | shouldAddShape(currentNode()); | 183 | shouldAddShape(currentNode()); | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 253 | { | |||
258 | updateGuideline(); | 258 | updateGuideline(); | ||
259 | endStroke(); | 259 | endStroke(); | ||
260 | } | 260 | } | ||
261 | 261 | | |||
262 | void KisToolLine::endStroke() | 262 | void KisToolLine::endStroke() | ||
263 | { | 263 | { | ||
264 | NodePaintAbility nodeAbility = nodePaintAbility(); | 264 | NodePaintAbility nodeAbility = nodePaintAbility(); | ||
265 | 265 | | |||
266 | if (!m_strokeIsRunning || m_startPoint == m_endPoint || nodeAbility == NONE) { | 266 | if (!m_strokeIsRunning || m_startPoint == m_endPoint || nodeAbility == UNPAINTABLE) { | ||
267 | return; | 267 | return; | ||
268 | } | 268 | } | ||
269 | 269 | | |||
270 | const KisToolShape::ShapeAddInfo info = | 270 | const KisToolShape::ShapeAddInfo info = | ||
271 | shouldAddShape(currentNode()); | 271 | shouldAddShape(currentNode()); | ||
272 | 272 | | |||
273 | if ((nodeAbility == PAINT && !info.shouldAddShape) || info.shouldAddSelectionShape) { | 273 | if ((nodeAbility == PAINT && !info.shouldAddShape) || info.shouldAddSelectionShape) { | ||
274 | updateStroke(); | 274 | updateStroke(); | ||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |