summaryrefslogtreecommitdiffstats
path: root/src/pen-context.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2012-12-24 11:42:35 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.marker.es>2012-12-24 11:42:35 +0000
commit69282d367f74bd425ae11cab845208250d38ca24 (patch)
tree4e49fc10e59f2683747f87dce707987f95378b8d /src/pen-context.cpp
parentBSpline + SpiroLive for testing (diff)
downloadinkscape-69282d367f74bd425ae11cab845208250d38ca24.tar.gz
inkscape-69282d367f74bd425ae11cab845208250d38ca24.zip
Fix shortcut Spiro to curve
(bzr r11950.1.8)
Diffstat (limited to 'src/pen-context.cpp')
-rw-r--r--src/pen-context.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index 20c95c13f..f6d07facc 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -1088,14 +1088,6 @@ static void pen_lastpoint_tocurve (SPPenContext *const pc)
return;
//BSpline
Geom::CubicBezier const * cubic;
- if(!pc->bspline){
- cubic = dynamic_cast<Geom::CubicBezier const *>( pc->green_curve->last_segment() );
- if ( cubic ) {
- pc->p[1] = pc->p[0] + (Geom::Point)( (*cubic)[3] - (*cubic)[2] );
- } else {
- pc->p[1] = pc->p[0] + (1./3)*(pc->p[3] - pc->p[0]);
- }
- }
//Para formar una curva necesitamos un nodo symm en el "lastpoint"
//de esta manera modificamos el final de la "curva_verde" para que sea symm con el pricipio de la "red_curve"
@@ -1105,8 +1097,7 @@ static void pen_lastpoint_tocurve (SPPenContext *const pc)
Geom::Point C(0,0);
Geom::Point D(0,0);
SPCurve * previous = new SPCurve();
- using Geom::X;
- using Geom::Y;
+ cubic = dynamic_cast<Geom::CubicBezier const *>( pc->green_curve->last_segment() );
//We obtain the last segment 4 points in the previous curve
if ( cubic ){
A = (*cubic)[0];
@@ -1119,7 +1110,6 @@ static void pen_lastpoint_tocurve (SPPenContext *const pc)
C = pc->p[0] + (Geom::Point)(pc->p[0] - pc->p[1]);
D = pc->green_curve->last_segment()->finalPoint();
}
- C = Geom::Point(C[X]+1,C[Y]+1);
previous->moveto(A);
previous->curveto(B, C, D);
if( pc->green_curve->get_segment_count() == 1){
@@ -1131,6 +1121,16 @@ static void pen_lastpoint_tocurve (SPPenContext *const pc)
pc->green_curve->append_continuous(previous, 0.0625);
}
}
+
+ if(!pc->bspline){
+ cubic = dynamic_cast<Geom::CubicBezier const *>( pc->green_curve->last_segment() );
+ if ( cubic ) {
+ pc->p[1] = pc->p[0] + (Geom::Point)( pc->p[0] - (*cubic)[2] );
+ } else {
+ pc->p[1] = pc->p[0] + (1./3)*(pc->p[3] - pc->p[0]);
+ }
+ }
+
//Para formar una curva bspline necesitamos un nodo cusp en el "lastpoint"
//de esta manera modificamos el final de la "curva_verde" para que sea cusp con el pricipio de la "red_curve"
//Que se quedarĂ¡ recta