diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop.cpp | 42 | ||||
| -rw-r--r-- | src/desktop.h | 5 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index ddd5dfe83..f33c2bc29 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1086,6 +1086,48 @@ SPDesktop::zoom_grab_focus() /** + * Rotate keeping the point 'c' fixed in the desktop window. + */ +void +SPDesktop::rotate_absolute_keep_point (Geom::Point const &c, double rotate) +{ + Geom::Point w = d2w( c ); // Must be before rotate changed. + _current_affine.setRotate( rotate ); + set_display_area( c, w ); +} + + +void +SPDesktop::rotate_relative_keep_point (Geom::Point const &c, double rotate) +{ + Geom::Point w = d2w( c ); // Must be before rotate changed. + _current_affine.addRotate( rotate ); + set_display_area( c, w ); +} + + +/** + * Rotate aligning the point 'c' to the center of desktop window. + */ +void +SPDesktop::rotate_absolute_center_point (Geom::Point const &c, double rotate) +{ + _current_affine.setRotate( rotate ); + Geom::Rect viewbox = canvas->getViewbox(); + set_display_area( c, viewbox.midpoint() ); +} + + +void +SPDesktop::rotate_relative_center_point (Geom::Point const &c, double rotate) +{ + _current_affine.addRotate( rotate ); + Geom::Rect viewbox = canvas->getViewbox(); + set_display_area( c, viewbox.midpoint() ); +} + + +/** * Scroll canvas by to a particular point (window coordinates). */ void diff --git a/src/desktop.h b/src/desktop.h index 2d2297c6b..3dc11b557 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -346,6 +346,11 @@ public: void zoom_grab_focus(); + void rotate_absolute_keep_point (Geom::Point const &c, double const rotate); + void rotate_relative_keep_point (Geom::Point const &c, double const rotate); + void rotate_absolute_center_point (Geom::Point const &c, double const rotate); + void rotate_relative_center_point (Geom::Point const &c, double const rotate); + void scroll_absolute (Geom::Point const &point, bool is_scrolling = false); void scroll_relative (Geom::Point const &delta, bool is_scrolling = false); void scroll_relative_in_svg_coords (double dx, double dy, bool is_scrolling = false); |
