index 8c12df55849eefce08b997fbf0fc1a87d1a06f95..ed89bf6aaf0945bb7acd2085b7ff5af4d9d27098 100644 (file)
{
if (selection && !selection->isEmpty()) {
if (!_check_move_relative.get_active()) {
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
double x = bbox->min()[Geom::X];
double y = bbox->min()[Geom::Y];
Transformation::updatePageScale(Inkscape::Selection *selection)
{
if (selection && !selection->isEmpty()) {
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
double w = bbox->extent(Geom::X);
double h = bbox->extent(Geom::Y);
Transformation::updatePageSkew(Inkscape::Selection *selection)
{
if (selection && !selection->isEmpty()) {
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
double w = bbox->extent(Geom::X);
double h = bbox->extent(Geom::Y);
if (_check_move_relative.get_active()) {
sp_selection_move_relative(selection, x, y);
} else {
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
sp_selection_move_relative(selection,
x - bbox->min()[Geom::X], y - bbox->min()[Geom::Y]);
it != selected.end();
++it)
{
- NR::Maybe<NR::Rect> bbox = sp_item_bbox_desktop(*it);
+ boost::optional<NR::Rect> bbox = sp_item_bbox_desktop(*it);
if (bbox) {
sorted.push_back(BBoxSort(*it, to_2geom(*bbox), Geom::X, x > 0? 1. : 0., x > 0? 0. : 1.));
}
it != selected.end();
++it)
{
- NR::Maybe<NR::Rect> bbox = sp_item_bbox_desktop(*it);
+ boost::optional<NR::Rect> bbox = sp_item_bbox_desktop(*it);
if (bbox) {
sorted.push_back(BBoxSort(*it, to_2geom(*bbox), Geom::Y, y > 0? 1. : 0., y > 0? 0. : 1.));
}
}
}
} else {
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
sp_selection_move_relative(selection,
x - bbox->min()[Geom::X], y - bbox->min()[Geom::Y]);
NR::scale scale (0,0);
// the values are increments!
if (_units_scale.isAbsolute()) {
- NR::Maybe<NR::Rect> bbox(sp_item_bbox_desktop(item));
+ boost::optional<NR::Rect> bbox(sp_item_bbox_desktop(item));
if (bbox) {
double new_width = scaleX;
if (fabs(new_width) < 1e-6) new_width = 1e-6; // not 0, as this would result in a nasty no-bbox object
sp_item_scale_rel (item, scale);
}
} else {
- NR::Maybe<NR::Rect> bbox(selection->bounds());
+ boost::optional<NR::Rect> bbox(selection->bounds());
if (bbox) {
Geom::Point center(bbox->midpoint()); // use rotation center?
NR::scale scale (0,0);
sp_item_rotate_rel(item, NR::rotate (angle*M_PI/180.0));
}
} else {
- NR::Maybe<NR::Point> center = selection->center();
+ boost::optional<NR::Point> center = selection->center();
if (center) {
sp_selection_rotate_relative(selection, *center, angle);
}
} else { // absolute displacement
double skewX = _scalar_skew_horizontal.getValue("px");
double skewY = _scalar_skew_vertical.getValue("px");
- NR::Maybe<NR::Rect> bbox(sp_item_bbox_desktop(item));
+ boost::optional<NR::Rect> bbox(sp_item_bbox_desktop(item));
if (bbox) {
double width = bbox->extent(Geom::X);
double height = bbox->extent(Geom::Y);
}
}
} else { // transform whole selection
- NR::Maybe<NR::Rect> bbox = selection->bounds();
- NR::Maybe<NR::Point> center = selection->center();
+ boost::optional<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Point> center = selection->center();
if ( bbox && center ) {
double width = bbox->extent(Geom::X);
//g_message("onMoveRelativeToggled: %f, %f px\n", x, y);
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
if (_check_move_relative.get_active()) {
_scalar_move_horizontal.setValue(0);
_scalar_move_vertical.setValue(0);
} else {
- NR::Maybe<NR::Rect> bbox = selection->bounds();
+ boost::optional<NR::Rect> bbox = selection->bounds();
if (bbox) {
_scalar_move_horizontal.setValue(bbox->min()[Geom::X], "px");
_scalar_move_vertical.setValue(bbox->min()[Geom::Y], "px");