Changeset View
Changeset View
Standalone View
Standalone View
libs/basicflakes/tools/KoCreatePathTool.cpp
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 57 | if (pathStarted()) { | |||
|---|---|---|---|---|---|
| 67 | painter.restore(); | 67 | painter.restore(); | ||
| 68 | 68 | | |||
| 69 | painter.save(); | 69 | painter.save(); | ||
| 70 | 70 | | |||
| 71 | painter.setTransform(d->shape->absoluteTransformation(&converter) * painter.transform()); | 71 | painter.setTransform(d->shape->absoluteTransformation(&converter) * painter.transform()); | ||
| 72 | 72 | | |||
| 73 | KoShape::applyConversion(painter, converter); | 73 | KoShape::applyConversion(painter, converter); | ||
| 74 | 74 | | |||
| 75 | painter.setPen(Qt::blue); | 75 | QPen pen(QBrush(Qt::blue), 1); | ||
| 76 | painter.setBrush(Qt::white); //TODO make configurable | 76 | pen.setCosmetic(true); | ||
| 77 | painter.setPen(pen); | ||||
| 78 | painter.setBrush(Qt::white); | ||||
| 77 | 79 | | |||
| 78 | const bool firstPoint = (d->firstPoint == d->activePoint); | 80 | const bool firstPoint = (d->firstPoint == d->activePoint); | ||
| 79 | 81 | | |||
| 80 | if (d->pointIsDragged || firstPoint) { | 82 | if (d->pointIsDragged || firstPoint) { | ||
| 81 | const bool onlyPaintActivePoints = false; | 83 | const bool onlyPaintActivePoints = false; | ||
| 82 | KoPathPoint::PointTypes paintFlags = KoPathPoint::ControlPoint2; | 84 | KoPathPoint::PointTypes paintFlags = KoPathPoint::ControlPoint2; | ||
| 83 | 85 | | |||
| 84 | if (d->activePoint->activeControlPoint1()) { | 86 | if (d->activePoint->activeControlPoint1()) { | ||
| 85 | paintFlags |= KoPathPoint::ControlPoint1; | 87 | paintFlags |= KoPathPoint::ControlPoint1; | ||
| 86 | } | 88 | } | ||
| 87 | d->activePoint->paint(painter, d->handleRadius, paintFlags, onlyPaintActivePoints); | 89 | d->activePoint->paint(painter, d->handleRadius, paintFlags, onlyPaintActivePoints); | ||
| 88 | } | 90 | } | ||
| 89 | 91 | | |||
| 90 | 92 | | |||
| 91 | // check if we have to color the first point | 93 | // check if we have to color the first point | ||
| 92 | if (d->mouseOverFirstPoint) { | 94 | if (d->mouseOverFirstPoint) { | ||
| 93 | painter.setBrush(Qt::red); //TODO make configurable | 95 | painter.setBrush(Qt::red); | ||
| 94 | } else { | 96 | } else { | ||
| 95 | painter.setBrush(Qt::white); //TODO make configurable | 97 | painter.setBrush(Qt::white); | ||
| 96 | } | 98 | } | ||
| 97 | 99 | | |||
| 98 | d->firstPoint->paint(painter, d->handleRadius, KoPathPoint::Node); | 100 | d->firstPoint->paint(painter, d->handleRadius, KoPathPoint::Node); | ||
| 99 | 101 | | |||
| 100 | painter.restore(); | 102 | painter.restore(); | ||
| 101 | } | 103 | } | ||
| 102 | 104 | | |||
| 103 | if (d->hoveredPoint) { | 105 | if (d->hoveredPoint) { | ||
| 104 | painter.save(); | 106 | painter.save(); | ||
| 105 | painter.setTransform(d->hoveredPoint->parent()->absoluteTransformation(&converter), true); | 107 | painter.setTransform(d->hoveredPoint->parent()->absoluteTransformation(&converter), true); | ||
| 106 | KoShape::applyConversion(painter, converter); | 108 | KoShape::applyConversion(painter, converter); | ||
| 107 | painter.setPen(Qt::blue); | 109 | QPen pen(QBrush(Qt::blue), 1); | ||
| 108 | painter.setBrush(Qt::white); //TODO make configurable | 110 | pen.setCosmetic(true); | ||
| 111 | painter.setPen(pen); | ||||
| 112 | painter.setBrush(Qt::white); | ||||
| 109 | d->hoveredPoint->paint(painter, d->handleRadius, KoPathPoint::Node); | 113 | d->hoveredPoint->paint(painter, d->handleRadius, KoPathPoint::Node); | ||
| 110 | painter.restore(); | 114 | painter.restore(); | ||
| 111 | } | 115 | } | ||
| 112 | 116 | | |||
| 113 | painter.save(); | 117 | painter.save(); | ||
| 114 | KoShape::applyConversion(painter, converter); | 118 | KoShape::applyConversion(painter, converter); | ||
| 115 | canvas()->snapGuide()->paint(painter, converter); | 119 | canvas()->snapGuide()->paint(painter, converter); | ||
| 116 | painter.restore(); | 120 | painter.restore(); | ||
| ▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines | |||||