equal
deleted
inserted
replaced
142 |
142 |
143 m_sin_theta = qFastSin(Q_PI / m_roundness); |
143 m_sin_theta = qFastSin(Q_PI / m_roundness); |
144 m_cos_theta = qFastCos(Q_PI / m_roundness); |
144 m_cos_theta = qFastCos(Q_PI / m_roundness); |
145 |
145 |
146 const qreal *endPts = pts + (count<<1); |
146 const qreal *endPts = pts + (count<<1); |
147 const qreal *startPts; |
147 const qreal *startPts = 0; |
148 |
148 |
149 Qt::PenCapStyle cap = m_cap_style; |
149 Qt::PenCapStyle cap = m_cap_style; |
150 |
150 |
151 if (!types) { |
151 if (!types) { |
|
152 // skip duplicate points |
|
153 while((pts + 2) < endPts && pts[0] == pts[2] && pts[1] == pts[3]) |
|
154 pts += 2; |
|
155 if ((pts + 2) == endPts) |
|
156 return; |
|
157 |
152 startPts = pts; |
158 startPts = pts; |
153 |
159 |
154 bool endsAtStart = startPts[0] == *(endPts-2) && startPts[1] == *(endPts-1); |
160 bool endsAtStart = startPts[0] == *(endPts-2) && startPts[1] == *(endPts-1); |
155 |
161 |
156 if (endsAtStart || path.hasImplicitClose()) |
162 if (endsAtStart || path.hasImplicitClose()) |
159 m_cap_style = cap; |
165 m_cap_style = cap; |
160 pts += 2; |
166 pts += 2; |
161 lineTo(pts); |
167 lineTo(pts); |
162 pts += 2; |
168 pts += 2; |
163 while (pts < endPts) { |
169 while (pts < endPts) { |
164 join(pts); |
170 if (m_cx != pts[0] || m_cy != pts[1]) { |
165 lineTo(pts); |
171 join(pts); |
|
172 lineTo(pts); |
|
173 } |
166 pts += 2; |
174 pts += 2; |
167 } |
175 } |
168 |
176 |
169 endCapOrJoinClosed(startPts, pts-2, path.hasImplicitClose(), endsAtStart); |
177 endCapOrJoinClosed(startPts, pts-2, path.hasImplicitClose(), endsAtStart); |
170 |
178 |
171 } else { |
179 } else { |
172 bool endsAtStart; |
180 bool endsAtStart = false; |
173 while (pts < endPts) { |
181 while (pts < endPts) { |
174 switch (*types) { |
182 switch (*types) { |
175 case QPainterPath::MoveToElement: { |
183 case QPainterPath::MoveToElement: { |
176 if (pts != path.points()) |
184 if (pts != path.points()) |
177 endCapOrJoinClosed(startPts, pts-2, path.hasImplicitClose(), endsAtStart); |
185 endCapOrJoinClosed(startPts, pts-2, path.hasImplicitClose(), endsAtStart); |