Commit Graph

10 Commits

Author SHA1 Message Date
Matthias Clasen
062902c003 Add a few annotations
Add a few pure, const and malloc annotations. These were suggested
by the gcc -Wsuggest-attribute option.
2023-12-26 21:57:04 -05:00
Benjamin Otte
9ffd7840ba pathpoint: Add G_GNUC_EXTENSION to struct definition
This allows compilation with gcc -pedantic.

GTKmm uses this as part of their recommended compiler flags.

Fixes #6083
2023-09-07 16:19:20 +02:00
Matthias Clasen
2e24a9ece4 Make GskPathPoint public
The contents are still /*< private >*/, but we
let our tests and the debugger see them, which
helps.
2023-08-28 00:07:50 -04:00
Matthias Clasen
007cfeac94 Add GskPathMeasure
GskPathMeasure is the public API for path lengths.
2023-08-25 20:16:49 -04:00
Matthias Clasen
e1faf28310 Make curvature api more flexible
Add an extra direction argument to get_curvature to
allow picking the limit on either side, for sharp turns.

Update all callers.
2023-08-24 14:32:33 -04:00
Matthias Clasen
148da12cfc Cosmetics 2023-08-18 13:19:33 -04:00
Matthias Clasen
a1d40c5236 Add gsk_path_point_get_rotation
This returns the tangent in the form of an angle.
2023-08-14 14:58:22 -04:00
Matthias Clasen
6ace4b60d8 pathpoint: Revise argument order
In order for introspection and documentation to
not be confused, we need to have the GskPathPoint
be the first argument.

Update all callers.
2023-08-14 13:20:34 -04:00
Matthias Clasen
5c55e9d11e Add gsk_path_point_equal/compare
These just make sense to have.
2023-08-08 22:05:34 -04:00
Matthias Clasen
1b5dfcba7e gsk: Add GskPath
This commit adds the basic infrastructure for paths.
The public APIs consists of GskPath, GskPathPoint and
GskPathBuilder.

GskPath is a data structure for paths that consists
of contours, which in turn might contain Bézier curves.
The Bezier data structure is inspired by Skia, with separate
arrays for points and operations. One advantage of this
arrangement is that start and end points are shared
between adjacent curves.

A GskPathPoint represents a point on a path, which can
be queried for various properties.

GskPathBuilder is an auxiliary builder object for paths.
2023-08-06 20:48:09 -04:00