Difference between revisions of "Rotating Canvas"
Jump to navigation
Jump to search
(→Steps) |
|||
Line 13: | Line 13: | ||
*** A point on the drawing and a point on the screen which are to be aligned. | *** A point on the drawing and a point on the screen which are to be aligned. | ||
** All basic zooming functions can be handled as special cases of this new function. | ** All basic zooming functions can be handled as special cases of this new function. | ||
+ | ** Update/replace all instances of set_display_area() to use new version. | ||
+ | ** Replace all instances of get_display_area() to handle rotated frame. | ||
* Add rotation functions that follows the zoom functions pattern. | * Add rotation functions that follows the zoom functions pattern. | ||
* Add GUI to set rotation. | * Add GUI to set rotation. |
Revision as of 14:26, 9 March 2017
Being able to rotate the canvas while working on a drawing is a highly desirable feature. Unfortunately, most of Inkscape's code assumes a non-rotating canvas.
Basic Strategy
The Inkscape SPDesktop class's Geom::Affine _w2d variable defines the Window to Desktop coordinate transformation (and _d2w defines the inverse). In 0.92.x _w2d is limited to scaling. Rotating the canvas can be added to this variable. It might also be possible to add translation (to handle scrolling) as well.
Steps
- Adapt current zooming code to work if _w2d includes a rotation.
- New function: SPDesktop::set_display_area() that takes as input:
- The current transformation (_w2d).
- A point on the drawing and a point on the screen which are to be aligned.
- All basic zooming functions can be handled as special cases of this new function.
- Update/replace all instances of set_display_area() to use new version.
- Replace all instances of get_display_area() to handle rotated frame.
- New function: SPDesktop::set_display_area() that takes as input:
- Add rotation functions that follows the zoom functions pattern.
- Add GUI to set rotation.
- Menu items with keyboard shortcuts.
- On-screen editing tools using a class derived from SPCanvasItem.
- Fix problems (see below).
Problems
- The tools (Rectangle, Path, etc.) seem to already work when _w2d includes a rotation.
- On screen elements need to be transformed.
- Guides (already shown at correct angles but ends are in wrong places.
- Grids
- Bounding boxes
- Page outline
- Scrolling needs to be adjusted (it should work using the center of the drawing).