=== modified file 'src/live_effects/lpe-copy_rotate.cpp'
--- src/live_effects/lpe-copy_rotate.cpp 2016-12-20 00:54:38 +0000
+++ src/live_effects/lpe-copy_rotate.cpp 2016-12-20 19:50:25 +0000
@@ -113,7 +113,7 @@
A = Point(boundingbox_X.min(), boundingbox_Y.middle());
B = Point(boundingbox_X.middle(), boundingbox_Y.middle());
- origin.param_setValue(A);
+ origin.param_setValue(A, true);
origin.param_update_default(A);
dist_angle_handle = L2(B - A);
dir = unit_vector(B - A);
@@ -171,7 +171,7 @@
start_pos = origin + dir * Rotate(-rad_from_deg(starting_angle)) * dist_angle_handle;
rot_pos = origin + dir * Rotate(-rad_from_deg(rotation_angle+starting_angle)) * dist_angle_handle;
if (near) {
- starting_point.param_setValue(start_pos);
+ starting_point.param_setValue(start_pos, true);
}
previous_start_point = (Geom::Point)starting_point;
if ( fuse_paths || copies_to_360 ) {
=== modified file 'src/live_effects/lpe-mirror_symmetry.cpp'
--- src/live_effects/lpe-mirror_symmetry.cpp 2016-12-20 00:54:38 +0000
+++ src/live_effects/lpe-mirror_symmetry.cpp 2016-12-20 20:44:11 +0000
@@ -113,46 +113,47 @@
point_a = Geom::Point(center_point[X],boundingbox_Y.min());
point_b = Geom::Point(center_point[X],boundingbox_Y.max());
}
- if (Geom::are_near((Geom::Point)start_point, (Geom::Point)end_point, 0.01)) {
- start_point.param_setValue(point_a);
- end_point.param_setValue(point_b);
+ if ((Geom::Point)start_point == (Geom::Point)end_point && (Geom::Point)start_point == Geom::Point(0,0)) {
+ start_point.param_setValue(point_a, true);
+ end_point.param_setValue(point_b, true);
+ previous_center = Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
+ center_point.param_setValue(previous_center, true);
}
if ( mode == MT_X || mode == MT_Y ) {
start_point.param_setValue(point_a, true);
end_point.param_setValue(point_b, true);
+ center_point.param_setValue(Geom::middle_point(point_a, point_b), true);
} else if ( mode == MT_FREE) {
- if(!are_near(previous_center,center_point, 0.01)) {
- Geom::Point trans = center_point - previous_center;
+ if (are_near(previous_center, (Geom::Point)center_point, 0.01)) {
+ center_point.param_setValue(Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point), true);
+ } else {
+ Geom::Point trans = center_point - Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
start_point.param_setValue(start_point * trans, true);
end_point.param_setValue(end_point * trans, true);
}
} else if ( mode == MT_V){
- if(SP_ACTIVE_DESKTOP){
- SPDocument * doc = SP_ACTIVE_DESKTOP->getDocument();
- Geom::Rect view_box_rect = doc->getViewBox();
- Geom::Point sp = Geom::Point(view_box_rect.width()/2.0, 0);
- sp *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
- start_point.param_setValue(sp, true);
- Geom::Point ep = Geom::Point(view_box_rect.width()/2.0, view_box_rect.height());
- ep *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
- end_point.param_setValue(ep, true);
- }
+ SPDocument * document = SP_ACTIVE_DOCUMENT;
+ Geom::Affine transform = i2anc_affine(SP_OBJECT(lpeitem), NULL).inverse();
+ Geom::Point sp = Geom::Point(document->getWidth().value("px")/2.0, 0) * transform;
+ start_point.param_setValue(sp, true);
+ Geom::Point ep = Geom::Point(document->getWidth().value("px")/2.0, document->getHeight().value("px")) * transform;
+ end_point.param_setValue(ep, true);
+ center_point.param_setValue(Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point), true);
+ previous_center = center_point;
} else { //horizontal page
- if(SP_ACTIVE_DESKTOP){
- SPDocument * doc = SP_ACTIVE_DESKTOP->getDocument();
- Geom::Rect view_box_rect = doc->getViewBox();
- Geom::Point sp = Geom::Point(0, view_box_rect.height()/2.0);
- sp *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
- start_point.param_setValue(sp, true);
- Geom::Point ep = Geom::Point(view_box_rect.width(), view_box_rect.height()/2.0);
- ep *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
- end_point.param_setValue(ep, true);
- }
- }
- previous_center = Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
- if (!are_near(previous_center, center_point,0.01)) {
- center_point.param_setValue(previous_center);
- }
+ SPDocument * document = SP_ACTIVE_DOCUMENT;
+ Geom::Affine transform = i2anc_affine(SP_OBJECT(lpeitem), NULL).inverse();
+ Geom::Point sp = Geom::Point(0, document->getHeight().value("px")/2.0) * transform;
+ start_point.param_setValue(sp, true);
+ Geom::Point ep = Geom::Point(document->getWidth().value("px"), document->getHeight().value("px")/2.0) * transform;
+ end_point.param_setValue(ep, true);
+ center_point.param_setValue(Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point), true);
+ previous_center = center_point;
+ }
+ if (!are_near(previous_center, (Geom::Point)center_point, 0.01)) {
+ center_point.param_setValue(Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point), true);
+ }
+ previous_center = center_point;
}
void
@@ -180,7 +181,7 @@
start_point.param_update_default(point_a);
end_point.param_setValue(point_b, true);
end_point.param_update_default(point_b);
- center_point.param_setValue(point_c);
+ center_point.param_setValue(point_c, true);
previous_center = center_point;
}
I want to apply this patch. Any problem. This fix the bugs noticed by suv on IRC and the patch is landed now in trunk.
Please log in to leave a comment!