Commit Graph

14 Commits

Author SHA1 Message Date
Benjamin Otte
5c77b02bac path: Change semantics of gtk_path_builder_add_segment()
Allow start >= end to mean that the path continues at the beginning
after reaching the end until it reaches the point at @end.
2020-12-27 20:08:53 +01:00
Benjamin Otte
7e10659b0c path: Add gsk_path_measure_is_closed () 2020-12-27 20:08:53 +01:00
Benjamin Otte
38a2da88fa path: Add gsk_path_measure_restrict_to_contour() 2020-12-27 20:08:53 +01:00
Matthias Clasen
749ae52ccd Add gsk_path_measure_get_{path,tolerance}
These are just nice apis to have and avoid having to carry
these around as extra arguments in many places.

This was showing up as inconvenience in writing tests
for the measure apis.
2020-12-27 20:08:53 +01:00
Benjamin Otte
70b84a7cc8 path: Rename to gtk_path_builder_add_segment()
It's about bulding paths, not about measuring them.
2020-12-27 20:08:53 +01:00
Benjamin Otte
0b7e0d4a9a path: Make all private contour APIs take a GskContour
... instead of a path, index tuple.
2020-12-27 20:08:53 +01:00
Matthias Clasen
04b9746bd5 Implement gsk_path_measure_in_fill
Implement this in the obvious way, using the decomposed form
of standard contours. Since the decomposed form is part of the
measure object, this api moves from gsk_path_in_fill to
gsk_path_measure_in_fill.
2020-12-27 20:08:53 +01:00
Matthias Clasen
5c15a265c5 Documentation typo fixes 2020-12-27 20:08:52 +01:00
Benjamin Otte
1c308f00b9 path: Split GskPathBuilder into its own file
... and add missing API docs.
2020-12-27 20:08:52 +01:00
Benjamin Otte
2cd08ecf77 path: Add gsk_path_measure_get_closest_point()
... and gsk_path_measure_get_closest_point_full().

Those 2 functions allow finding the closest point on a path to a given
point.
2020-12-27 20:08:52 +01:00
Benjamin Otte
4a1dcefca6 path: Add gsk_path_measure_get_point()
Allows querying the coordinates and direction of any specific point on a
path.
2020-12-27 20:08:52 +01:00
Benjamin Otte
9fd1dea356 pathmeasure: Implement support for beziers
Instead of treating bezier curves as lines, we properly decompose them
into line segments now so that we can treat those as lines.
2020-12-27 20:08:52 +01:00
Benjamin Otte
53b64f63f1 pathmeasure: Add gsk_path_measure_add_segment()
This allows chunking paths, weeee.
2020-12-27 20:08:52 +01:00
Benjamin Otte
0e69f58c2b gsk: Add GskPathMeasure
An object to do measuring operations on paths - determining their
length, cutting off subpaths, things like that.
2020-12-27 20:08:52 +01:00