Guides API: add functionality to get and set y coordinate in the post-1.0 coordinate system
What does the merge request do?
- Adds a new attribute
position
to the guide, which is the position in the post-1.0 coordinate system (y pointing downwards, zero at the top left corner of the viewbox) - The old attribute
point
is deprecated, if the raw position is wanted, explicitly useGuide.raw_position
-
NamedView.new_guide
,NamedView.new_unique_guide
andGuide.move_to
have been deprecated. This is a preparation for a new guide element in Inkscape which is defined in the user coordinate system.NamedView.new_guide
,NamedView.add_unique_guide
andGuide.set_position
are the replacements and use the new coordinate system. - Angles / normal vectors are also evaluated in the post 1.0 coordinate system (i.e. clockwise angles). The new property
Guide.angle
returns the angle in the post-1.0 coordinate system in degrees. - All extensions reading and creating guides have been checked if the API usage can be simplified (and deprecated calls removed)
- Added very extensive docstrings. This might be a little bit exaggerated, but I'd rather document this change properly.
Brought up by @Moini in !480 (comment 965090094)
Summary for release notes
The Guides API has been rewritten to get and set guide properties in the post-1.0 coordinate system, as the current guide API is rather confusing in a multipage setting. For this, Guide.point
has been deprecated in favor of Guide.position
(new coordinate system) and Guide.raw_position
(old coordinate system). Also, NamedView.new_guide
, NamedView.new_unique_guide
and Guide.move_to
have been deprecated in favor of NamedView.new_guide
, NamedView.add_unique_guide
and Guide.set_position
.
Checklist
-
Add unit tests (if applicable) -
Changes to inkex/
are well documented -
Clean merge request history
Edited by Jonathan Neuhauser