diff options
Diffstat (limited to 'src/sp-path.cpp')
| -rw-r--r-- | src/sp-path.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/sp-path.cpp b/src/sp-path.cpp index e401d0a20..7dbe51c26 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -377,24 +377,18 @@ sp_path_set_transform(SPItem *item, NR::Matrix const &xform) return NR::identity(); } - if (path->original_curve) { /* Transform the original-d path */ - NRBPath dorigpath, sorigpath; - sorigpath.path = SP_CURVE_BPATH(path->original_curve); - nr_path_duplicate_transform(&dorigpath, &sorigpath, xform); - SPCurve *origcurve = sp_curve_new_from_bpath(dorigpath.path); - if (origcurve) { - sp_path_set_original_curve(path, origcurve, TRUE, true); - sp_curve_unref(origcurve); - } - } else { /* Transform the path */ - NRBPath dpath, spath; - spath.path = SP_CURVE_BPATH(shape->curve); - nr_path_duplicate_transform(&dpath, &spath, xform); - SPCurve *curve = sp_curve_new_from_bpath(dpath.path); - if (curve) { - sp_shape_set_curve(shape, curve, TRUE); - sp_curve_unref(curve); + // Transform the original-d path or the (ordinary) path + bool original_path = (bool)path->original_curve; + SPCurve *srccurve = original_path ? path->original_curve : shape->curve; + SPCurve *dstcurve = sp_curve_copy(srccurve); + if (dstcurve) { + sp_curve_transform(dstcurve, xform); + if (original_path) { + sp_path_set_original_curve(path, dstcurve, TRUE, true); + } else { + sp_shape_set_curve(shape, dstcurve, TRUE); } + sp_curve_unref(dstcurve); } // Adjust stroke |
