@@ -2141,29 +2141,31 @@ void OcdFileImport::setPathHolePoint(OcdImportedPathObject *object, quint32 pos)
21412141 object->coords [pos].setHolePoint (true );
21422142}
21432143
2144- void OcdFileImport::setPointFlags (OcdImportedPathObject* object, quint32 pos, bool is_area, const Ocd::OcdPoint32& ocd_point)
2145- {
2146- // We can support CurveStart, HolePoint, DashPoint.
2147- // CurveStart needs to be applied to the main point though, not the control point, and
2148- // hole points need to bet set as the last point of a part of an area object instead of the first point of the next part
2149- if (ocd_point.x & Ocd::OcdPoint32::FlagCtl1 && pos > 0 )
2150- object->coords [pos-1 ].setCurveStart (true );
2151- if ((ocd_point.y & Ocd::OcdPoint32::FlagDash) || (ocd_point.y & Ocd::OcdPoint32::FlagCorner))
2152- object->coords [pos].setDashPoint (true );
2153- if (ocd_point.y & Ocd::OcdPoint32::FlagHole && pos > 1 && is_area)
2154- setPathHolePoint (object, pos - 1 );
2155- }
2156-
21572144/* * Translates the OC*D path given in the last two arguments into an Object.
21582145 */
21592146void OcdFileImport::fillPathCoords (OcdImportedPathObject *object, bool is_area, quint32 num_points, const Ocd::OcdPoint32* ocd_points)
21602147{
21612148 object->coords .resize (num_points);
21622149 for (auto i = 0u ; i < num_points; i++)
21632150 {
2164- object->coords [i] = convertOcdPoint (ocd_points[i]);
2165- setPointFlags (object, i, is_area, ocd_points[i]);
2166- }
2151+ const auto & ocd_point = ocd_points[i];
2152+ object->coords [i] = convertOcdPoint (ocd_point);
2153+ if ((ocd_point.y & Ocd::OcdPoint32::FlagDash) || (ocd_point.y & Ocd::OcdPoint32::FlagCorner))
2154+ {
2155+ object->coords [i].setDashPoint (true );
2156+ }
2157+
2158+ if (ocd_point.x & Ocd::OcdPoint32::FlagCtl1 && i > 0 )
2159+ {
2160+ // CurveStart needs to be applied to the start point
2161+ object->coords [i-1 ].setCurveStart (true );
2162+ }
2163+
2164+ if (ocd_point.y & Ocd::OcdPoint32::FlagHole && is_area && i > 1 )
2165+ {
2166+ setPathHolePoint (object, i - 1 );
2167+ }
2168+ };
21672169
21682170 // For path objects, create closed parts where the position of the last point is equal to that of the first point
21692171 if (object->getType () == Object::Path)
0 commit comments