| 2101 | } |
| 2102 | |
| 2103 | bool PathObject::convertToCurves(PathObject** undo_duplicate) |
| 2104 | { |
| 2105 | bool converted_a_range = false; |
| 2106 | for (const auto& part : path_parts) |
| 2107 | { |
| 2108 | for (auto index = part.first_index; index < part.last_index; index += 3) |
| 2109 | { |
| 2110 | if (!coords[index].isCurveStart()) |
| 2111 | { |
| 2112 | auto end_index = index + 1; |
| 2113 | while (end_index < part.last_index && !coords[end_index].isCurveStart()) |
| 2114 | ++end_index; |
| 2115 | |
| 2116 | if (!converted_a_range) |
| 2117 | { |
| 2118 | if (undo_duplicate) |
| 2119 | *undo_duplicate = duplicate()->asPath(); |
| 2120 | converted_a_range = true; |
| 2121 | } |
| 2122 | |
| 2123 | index = convertRangeToCurves(part, index, end_index); |
| 2124 | } |
| 2125 | } |
| 2126 | } |
| 2127 | |
| 2128 | Q_ASSERT(!converted_a_range || isOutputDirty()); |
| 2129 | return converted_a_range; |
| 2130 | } |
| 2131 | |
| 2132 | PathPart::size_type PathObject::convertRangeToCurves(const PathPart& part, PathPart::size_type start_index, PathPart::size_type end_index) |
| 2133 | { |
no test coverage detected