Difference between revisions of "Rotating Canvas"
Jump to navigation
Jump to search
(→Steps) |
|||
Line 23: | Line 23: | ||
== Problems == | == Problems == | ||
− | * | + | * ✔The tools (Rectangle, Path, etc.) seem to already work when _w2d includes a rotation. |
* On screen elements need to be transformed. | * On screen elements need to be transformed. | ||
− | ** | + | ** ✔Guides (already shown at correct angles but ends are in wrong places. |
** Grids | ** Grids | ||
− | ** Bounding boxes | + | ** Bounding boxes (CtrlRect) |
− | ** Page outline | + | ** Page outline (CtrlRect) |
− | * | + | ** Arrow handles for resize, skew, ... |
+ | * ✔Scrolling needs to be adjusted. |
Revision as of 11:19, 15 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. Not needed?
- ✔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 (CtrlRect)
- Page outline (CtrlRect)
- Arrow handles for resize, skew, ...
- ✔Scrolling needs to be adjusted.