79
81
_page_rotate (4, 2),
81
83
_page_transform (3, 3),
82
_scalar_move_horizontal (_("_Horizontal"), _("Horizontal displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR,
84
_scalar_move_horizontal (_("_Horizontal:"), _("Horizontal displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR,
83
85
"", "transform-move-horizontal", &_units_move),
84
_scalar_move_vertical (_("_Vertical"), _("Vertical displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR,
86
_scalar_move_vertical (_("_Vertical:"), _("Vertical displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR,
85
87
"", "transform-move-vertical", &_units_move),
86
_scalar_scale_horizontal(_("_Width"), _("Horizontal size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS,
88
_scalar_scale_horizontal(_("_Width:"), _("Horizontal size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS,
87
89
"", "transform-scale-horizontal", &_units_scale),
88
_scalar_scale_vertical (_("_Height"), _("Vertical size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS,
90
_scalar_scale_vertical (_("_Height:"), _("Vertical size (absolute or percentage of current)"), UNIT_TYPE_DIMENSIONLESS,
89
91
"", "transform-scale-vertical", &_units_scale),
90
_scalar_rotate (_("A_ngle"), _("Rotation angle (positive = counterclockwise)"), UNIT_TYPE_RADIAL,
92
_scalar_rotate (_("A_ngle:"), _("Rotation angle (positive = counterclockwise)"), UNIT_TYPE_RADIAL,
91
93
"", "transform-rotate", &_units_rotate),
92
_scalar_skew_horizontal (_("_Horizontal"), _("Horizontal skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
94
_scalar_skew_horizontal (_("_Horizontal:"), _("Horizontal skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
93
95
"", "transform-skew-horizontal", &_units_skew),
94
_scalar_skew_vertical (_("_Vertical"), _("Vertical skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
96
_scalar_skew_vertical (_("_Vertical:"), _("Vertical skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
95
97
"", "transform-skew-vertical", &_units_skew),
97
_scalar_transform_a ("_A", _("Transformation matrix element A")),
98
_scalar_transform_b ("_B", _("Transformation matrix element B")),
99
_scalar_transform_c ("_C", _("Transformation matrix element C")),
100
_scalar_transform_d ("_D", _("Transformation matrix element D")),
101
_scalar_transform_e ("_E", _("Transformation matrix element E")),
102
_scalar_transform_f ("_F", _("Transformation matrix element F")),
99
_scalar_transform_a ("_A:", _("Transformation matrix element A")),
100
_scalar_transform_b ("_B:", _("Transformation matrix element B")),
101
_scalar_transform_c ("_C:", _("Transformation matrix element C")),
102
_scalar_transform_d ("_D:", _("Transformation matrix element D")),
103
_scalar_transform_e ("_E:", _("Transformation matrix element E")),
104
_scalar_transform_f ("_F:", _("Transformation matrix element F")),
104
106
_check_move_relative (_("Rela_tive move"), _("Add the specified relative displacement to the current position; otherwise, edit the current absolute position directly")),
105
_check_scale_proportional (_("Scale proportionally"), _("Preserve the width/height ratio of the scaled objects")),
107
_check_scale_proportional (_("_Scale proportionally"), _("Preserve the width/height ratio of the scaled objects")),
106
108
_check_apply_separately (_("Apply to each _object separately"), _("Apply the scale/rotate/skew to each selected object separately; otherwise, transform the selection as a whole")),
107
109
_check_replace_matrix (_("Edit c_urrent matrix"), _("Edit the current transform= matrix; otherwise, post-multiply transform= by this matrix"))
830
841
double e = _scalar_transform_e.getValue();
831
842
double f = _scalar_transform_f.getValue();
833
Geom::Matrix displayed(a, b, c, d, e, f);
844
Geom::Affine displayed(a, b, c, d, e, f);
835
846
if (_check_replace_matrix.get_active()) {
836
847
for (GSList const *l = selection->itemList(); l != NULL; l = l->next) {
837
848
SPItem *item = SP_ITEM(l->data);
838
sp_item_set_item_transform(item, displayed);
849
item->set_item_transform(displayed);
839
850
SP_OBJECT(item)->updateRepr();
842
853
sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform
845
sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
846
_("Edit transformation matrix"));
856
DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
857
_("Edit transformation matrix"));
871
882
double x = _scalar_move_horizontal.getValue("px");
872
883
double y = _scalar_move_vertical.getValue("px");
885
double conversion = _units_move.getConversion("px");
874
887
//g_message("onMoveRelativeToggled: %f, %f px\n", x, y);
876
Geom::OptRect bbox = selection->bounds();
889
Geom::OptRect bbox = selection->visualBounds();
879
892
if (_check_move_relative.get_active()) {
880
893
// From absolute to relative
881
_scalar_move_horizontal.setValue(x - bbox->min()[Geom::X], "px");
882
_scalar_move_vertical.setValue( y - bbox->min()[Geom::Y], "px");
894
_scalar_move_horizontal.setValue((x - bbox->min()[Geom::X]) / conversion);
895
_scalar_move_vertical.setValue(( y - bbox->min()[Geom::Y]) / conversion);
884
897
// From relative to absolute
885
_scalar_move_horizontal.setValue(bbox->min()[Geom::X] + x, "px");
886
_scalar_move_vertical.setValue( bbox->min()[Geom::Y] + y, "px");
898
_scalar_move_horizontal.setValue((bbox->min()[Geom::X] + x) / conversion);
899
_scalar_move_vertical.setValue(( bbox->min()[Geom::Y] + y) / conversion);