Changeset View
Changeset View
Standalone View
Standalone View
ui/annotationtools.cpp
| Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | |||||
| 165 | { | 165 | { | ||
| 166 | // draw SmoothPaths with at least 2 points | 166 | // draw SmoothPaths with at least 2 points | ||
| 167 | if ( points.count() > 1 ) | 167 | if ( points.count() > 1 ) | ||
| 168 | { | 168 | { | ||
| 169 | painter->setCompositionMode( compositionMode ); | 169 | painter->setCompositionMode( compositionMode ); | ||
| 170 | painter->setPen( pen ); | 170 | painter->setPen( pen ); | ||
| 171 | painter->setOpacity( opacity ); | 171 | painter->setOpacity( opacity ); | ||
| 172 | 172 | | |||
| 173 | QPainterPath path; | ||||
| 173 | QLinkedList<Okular::NormalizedPoint>::const_iterator pIt = points.begin(), pEnd = points.end(); | 174 | QLinkedList<Okular::NormalizedPoint>::const_iterator pIt = points.begin(), pEnd = points.end(); | ||
| 174 | Okular::NormalizedPoint pA = *pIt; | 175 | path.moveTo( QPointF( pIt->x * xScale, pIt->y * yScale ) ); | ||
| 175 | ++pIt; | 176 | ++pIt; | ||
| 176 | for ( ; pIt != pEnd; ++pIt ) | 177 | for ( ; pIt != pEnd; ++pIt ) | ||
| 177 | { | 178 | { | ||
| 178 | Okular::NormalizedPoint pB = *pIt; | 179 | path.lineTo( QPointF( pIt->x * xScale, pIt->y * yScale ) ); | ||
| 179 | painter->drawLine( (int)(pA.x * (double)xScale), (int)(pA.y * (double)yScale), | | |||
| 180 | (int)(pB.x * (double)xScale), (int)(pB.y * (double)yScale) ); | | |||
| 181 | pA = pB; | | |||
| 182 | } | 180 | } | ||
| 181 | painter->drawPath(path); | ||||
| 183 | } | 182 | } | ||
| 184 | } | 183 | } | ||
| 185 | 184 | | |||
| 186 | QList< Okular::Annotation* > SmoothPathEngine::end() | 185 | QList< Okular::Annotation* > SmoothPathEngine::end() | ||
| 187 | { | 186 | { | ||
| 188 | m_creationCompleted = false; | 187 | m_creationCompleted = false; | ||
| 189 | 188 | | |||
| 190 | // find out annotation's description node | 189 | // find out annotation's description node | ||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||