Matthias Clasen
11b219bc61
Drop tolerance from gsk_contour_foreach
...
There is no decomposition going on for any contours,
and the tolerance argument is entirely unused.
Decomposition and tolerance is handled entirely
in gskpath.c by its trampoline.
2023-08-28 20:52:22 -04:00
Matthias Clasen
5721c3cb8f
demos: Drop an unused variable
2023-08-28 20:50:38 -04:00
Fran Dieguez
f90ca697af
Update Galician translation
2023-08-28 22:36:51 +00:00
Matthias Clasen
e81aa18c82
Merge branch 'closest-point-distance' into 'main'
...
Change gsk_path_get_closest_point to return distance
See merge request GNOME/gtk!6357
2023-08-28 15:53:51 +00:00
Matthias Clasen
827bbc0cc1
Change gsk_path_get_closest_point to return distance
...
We already compute it, so lets return it.
Bindings seems fine with this change - they
already return (success, point) as a tuple
anyway.
2023-08-28 11:22:30 -04:00
Matthias Clasen
7095a67910
Merge branch 'matthiasc/for-main' into 'main'
...
path-tool: Add a reverse command
See merge request GNOME/gtk!6356
2023-08-28 04:38:42 +00:00
Matthias Clasen
dcbca3f0d7
path-tool: Add a reverse command
...
It does what it says.
2023-08-28 00:27:29 -04:00
Matthias Clasen
702d7c238a
Merge branch 'matthiasc/for-main' into 'main'
...
contour: Simplify gsk_circle_contour_foreach
See merge request GNOME/gtk!6355
2023-08-28 04:18:48 +00:00
Matthias Clasen
5a3ed65ad8
Improve precondition checks for path points
...
Add a helper function for checking that a
path point is valid for a path, and use it.
2023-08-28 00:07:50 -04: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
2a17320314
Limit rect variation in path builder
...
Make gsk_path_builder_add_rect always
produce a clockwise rectangle. This matches
what we do for circles and rounded rects,
which also go clockwise. Note that we
still need to allow negative widths in
the contour code, to implement reverse().
2023-08-28 00:07:50 -04:00
Matthias Clasen
0dbff14555
Allow circles with radius of zero
...
Not very useful, but we allow rects with
width and height of zero, so lets be consistent.
Curvature is infinite for such contours.
Tests included.
2023-08-28 00:07:50 -04:00
Matthias Clasen
c5d89d00f1
Merge branch 'zbrown/tooltips' into 'main'
...
tooltip: don't cross native boundaries
Closes #1234 , #5998 , gnome-calendar#1038, and nautilus#3063
See merge request GNOME/gtk!6346
2023-08-28 03:25:44 +00:00
Matthias Clasen
6f3be310f4
contour: Simplify gsk_circle_contour_foreach
...
Use the same approach as the rounded rect contour.
2023-08-27 21:31:40 -04:00
Matthias Clasen
0ea6b70d55
Merge branch 'matthiasc/for-main' into 'main'
...
gtk-demo: Add a few path benchmarks
See merge request GNOME/gtk!6353
2023-08-27 23:45:59 +00:00
Matthias Clasen
2ca9982b91
rect contour: Avoid nans in corner cases
...
The length of rect contours can be zero,
so we much check before we divide.
2023-08-27 19:17:02 -04:00
Matthias Clasen
a40282b2fb
Add gsk_path_point_print
...
Another private debug API.
2023-08-27 19:06:39 -04:00
Matthias Clasen
ad9fb1e101
Improve quad and conic decomposition
...
If the control point is equal to either
start or end, just emit a line. This improves
the rendering of rounded rectangles with such
corners.
2023-08-27 16:57:03 -04:00
Matthias Clasen
02a9652af4
Use a more compact representation for circles
...
Print circles as M-o-o-o-o-z.
2023-08-27 14:32:21 -04:00
Matthias Clasen
6f823d2d0d
gtk-demo: Add a few path benchmarks
...
The Tiger and Graph examples in the fishbowl test
path handling.
2023-08-27 12:59:10 -04:00
Matthias Clasen
a5c9cd5657
Merge branch 'rectangle-contour' into 'main'
...
Add a rectangle contour
See merge request GNOME/gtk!6351
2023-08-27 16:46:12 +00:00
Matthias Clasen
21ab5b6fa3
Merge branch 'matthiasc/for-main' into 'main'
...
Add a test for rectangle segments
See merge request GNOME/gtk!6352
2023-08-27 16:45:58 +00:00
Benjamin Otte
2582fd45e4
demos: Add cute maze demo
2023-08-27 12:45:25 -04:00
Matthias Clasen
0a28a5d53a
Add a rectangle contour
...
Add a contour that optimizes some things for
rectangles. Also add rectangle detection to the
path parser, and add tests similar to what we
have for the other special contours.
2023-08-27 12:36:56 -04:00
Matthias Clasen
ddd4855bbc
Add a test for rectangle segments
2023-08-27 12:36:30 -04:00
Matthias Clasen
204216e3d5
Merge branch 'matthiasc/for-main' into 'main'
...
Drop unused code
See merge request GNOME/gtk!6350
2023-08-27 16:19:16 +00:00
Matthias Clasen
1e6a124665
Correct the docs of gsk_path_builder_add_rect
...
The path does *not* always go clockwise!
2023-08-27 12:18:36 -04:00
Matthias Clasen
78c5aff956
Test special contours harder
...
Check that the start- and endpoint work
as expected and verify that their winding
numbers match the ones of the standard contour,
and are negated when the contour is reversed.
2023-08-27 11:47:40 -04:00
Matthias Clasen
8d1844135b
path: Add a comment
2023-08-27 10:10:08 -04:00
Matthias Clasen
b5dd9dae0d
rounded rect contour: Fix an oversight
...
The close operation takes 2 points, so our array
was one too short. Oops.
2023-08-27 10:09:32 -04:00
Matthias Clasen
ebcb518e4f
Cosmetics
2023-08-27 09:50:16 -04:00
Matthias Clasen
b7ea22f168
Drop unused code
...
Nobody is calling gsk_contour_get_start_end, so drop
this internal API.
2023-08-27 09:39:59 -04:00
Matthias Clasen
f0b3381660
Merge branch 'rounded-rect-contour' into 'main'
...
path: Add a rounded rect contour
See merge request GNOME/gtk!6347
2023-08-27 13:36:53 +00:00
Matthias Clasen
0796c72049
Add roundtrip tests for rounded rect contours
...
These should survive roundtrips through the
path parser as well now.
2023-08-27 09:31:17 -04:00
Matthias Clasen
822e988efe
path: Recognize rounded rects when parsing
...
We can look out for M-L-O-L-O-L-O-L-O-Z patterns
with matching numbers.
2023-08-27 09:31:17 -04:00
Matthias Clasen
cee043f977
Add a rounded rect contour
...
This special contour takes advantage of its
rounded-rect-ness for speeding up bounding
boxes and winding numbers. It falls back
to the standard contour code for everything
else.
2023-08-27 09:29:19 -04:00
Matthias Clasen
b420540b15
Merge branch 'matthiasc/for-main' into 'main'
...
Simplify the path spinner demo
See merge request GNOME/gtk!6349
2023-08-27 13:27:50 +00:00
Matthias Clasen
031c0ec3e5
pathpoint: Add some debug API
...
Add a private gsk_path_point_to_string that
can be called in the debugger if you want
to see the contents of a GskPathPoint and
are too lazy to cast it to GskRealPathPoint
yourself.
2023-08-27 09:14:47 -04:00
Matthias Clasen
43b6822eb0
Add roundtrip tests for special contours
...
So far, we only have a circle contour.
Check that it survives a roundtrip through
gsk_path_to_string and gsk_path_parse.
2023-08-27 09:14:03 -04:00
Matthias Clasen
ba3a657c48
contour: Add some debug API
...
Add a private way to get the class of a contour,
so we can test that roundtrips through gsk_path_parse
work as expected.
2023-08-27 09:13:32 -04:00
Matthias Clasen
5f2f116c28
circle contour: Fix a typo
2023-08-27 07:43:55 -04:00
Matthias Clasen
1db75e521d
Simplify the path spinner demo
...
The transforms were obscuring a simple
calculation here.
2023-08-27 07:43:55 -04:00
Matthias Clasen
2297a353b8
Merge branch 'circle-contour' into 'main'
...
path: Add a circle contour
See merge request GNOME/gtk!6345
2023-08-27 11:12:51 +00:00
Matthias Clasen
80903e5f44
Merge branch 'bilelmoussaoui/gi' into 'main'
...
gi: Add missing since annotation
See merge request GNOME/gtk!6348
2023-08-27 11:05:31 +00:00
Bilal Elmoussaoui
7342ce5bca
gi: Add missing since annotation
2023-08-27 08:17:00 +00:00
Matthias Clasen
167b38dfa1
contour: Some reactoring
...
Make a default print implementation, and use it.
2023-08-26 23:42:52 -04:00
Matthias Clasen
ead88c36ec
path: Add circle tests
2023-08-26 23:42:52 -04:00
Matthias Clasen
b8a3d7fa00
path: Recognize circles when parsing
...
We can look out for the tell-tale
M-O-O-O-O-Z and turn it into a circle
contour.
2023-08-26 23:42:52 -04:00
Matthias Clasen
0fce24674a
path: Add a circle contour
...
This special contour takes advantage of the
circle definition to speed up things like
hit testing and closest point determination.
2023-08-26 23:42:52 -04:00
Zander Brown
739084e9bc
tooltip: don't cross native boundaries
...
When walking the tree looking for tooltips we shouldn't cross from, say,
a popover to it's parent window
Fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/1234
Fix: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1038
Fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/5998
Fix: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3063
See: https://gitlab.gnome.org/GNOME/console/-/issues/318
2023-08-27 02:36:51 +01:00