Use `Main._findModal` instead of `Main.actionMode` as the criterion of the toggle direction.
Main.actionMode is not a safe criterion to know if the area is modal. For example, `Main.actionMode` is modified when toggling overview while drawing.
While attributes are not changed in user.css, they are persistent through drawing mode toggling. Css attributes that are modifiable in the user interface are just default attributes.
Close#27
* Populate 'Open' and 'Save' submenu on opening. It prevents the 'jump'.
* By removing the previous trick, it now give the key-focus to the first item when opening the menu with 'Menu' key.
* Close menu before toggling modal (before because the menu changes `Main.actionMode`).
* Hide the helper and update the grid display when toggling modal.
* Signal `stop-drawing` -> `leave-drawing-mode` for consistence.
* `area.disable` -> area `destroy` event handler.
* `area.isInDrawingMode` -> `area.reactive`.
Keybinding to ungrab keyboard and mouse while drawing remains at the top.
To be aware that this create some problems with the shell (DnD #1 and maybe more ?).
related to #6, #9, #20, #24, #33
* Fix reflection and inversion SVG transformations.
* Remove the Cairo wrappers (crRotate, crScale, crTranslate).
* Cairo transformation builds are now similar to SVG transformation builds.
Since reflection and inversion introductions, compute center only with the slides of the traslations is not correct.
* `_getCenter` -> `_getOriginalCenter`
* `_getCenterWithSlide` -> `_getTransformedCenter`
* Use pango matrices to compute the new center position since matrices from Cairo, Graphene, ..., are not available with GJS.
* Stock original center and transformed center to not compute it numerous time.
Use `cr.fillPreserve, ..., then cr.stroke` instead of `cr.copyPath, ..., cr.stroke, cr.appendPath, cr.fill`
Was there a reason for painting stroke before fill ?
Is something broken ?
* Use `cr.save` and `cr.stroke` (Restore the context but not the path).
* Use `cr.identityMatrix` to clean context after transformations.
Inverting transformations was not enough, in particular with combinations of scale and rotate (`SCALE_ANGLE`, `REFLECTION`, ...).
Now all elements can be grabbed correctly.
* `SCALE_PRESERVE` (preserve ratio)
* `SCALE` (vertical, horizontal or both)
There is a third transformation, `SCALE_ANGLE`, that is not used because it causes problems to the `elementFinder`. Probably a bug of Cairo.inStroke that do no consider scales.
* 'Shapes' -> 'Tools' ('Shapes' + 'Manipulations')
* 'TextState' -> 'TextStates'
* Rotation centers are now computed dynamically (when building Cairo or SVG paths).
* Text rotation center is now located at the beginning of the text.
* Text elements gain a 'lineIndex' attribute to retrieve the rotation center of the first line.
```
JS WARNING: [/home/.../draw.js 997]: reference to undefined property "state"
```
The state property is undefined if the element is loaded from json file.