Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite & amend symmetry state, overlay & editing
Fairly substantial refactoring - summary of user-facing changes: Disable button (w. trashcan icon) always drawn, when in edit mode. Disable button positioned as close to _symmetry center_ as possible, rather than as close to the _viewport center_ as possible. This is so that it can be used as an indicator for the location of the symmetry center, when the center is outside the viewport. Note that for the original symmetry mode, the location of the center had no relevance. When in edit mode, there is now a center marker that can be used to move the symmetry center by dragging - takes priority over individual axes. Statusbar messages now update correctly (minor thinko in old code, _last_msg_zone not always updated when moving to default zone). For the Rotational and Snowflake modes - axes are drawn for each line, rather than drawing the same axes as for Vertical+Horizontal. Axes are highlighted correctly when hovered over when in edit mode, regardless of view transformation (old checks were made in display space rather than model space). When adjusting transformation based on a single axis, the change to the center is locked based on the model-space angle of the axis, meaning that e.g. dragging a vertical axis will only affect the x-coordinate of the center, regardless of view transformation, but dragging a "vertical" axis with a non-90° angle will change both the x- and y-coordinates of the center. The TiledDrawWidget get_move_cursor_name_for_edge method has been refactored as part of this commit. It now uses the related functions in lib.alg, and no longer returns the distance. The symmetry gui code was the only user of that method. Positional scaling of alpha values when in edit mode is removed. Instead, the alpha value is clamped to a minimum of 25% opacity, except for when the alpha value is edited. == Internal refactoring and bug fixes == An "unset state" is now flagged separately instead of using None for center coordinates. State setters simplified accordingly. Use a tuple for center coordinates. Use `handler_block` to avoid event cycles. Only call symmetry_state_changed with parameters that have actually changed, and set the remaining ones to None - allowing more granular handling in the event listeners.
- Loading branch information