Matthias Clasen
04e6fc3f74
curve: Add length computation
...
Add api to go t<>length.
The code here is inspired by
https://pomax.github.io/bezierinfo/#arclength
2023-08-25 16:13:36 -04:00
Benjamin Otte
54d2f0063a
Merge branch 'replay' into 'main'
...
Node replay tests
See merge request GNOME/gtk!6299
2023-08-25 19:45:34 +00:00
Benjamin Otte
ae7ec40cf2
rendernodeparser: Generate better default child
...
... for fill and stroke nodes.
It's most likely we want the path bounds (or path stroke bounds),
so make the parser use those by default.
2023-08-25 21:12:12 +02:00
Matthias Clasen
d586a5c67c
Merge branch 'fix-gears-demo' into 'main'
...
demo: Fix a bug without GL
Closes #6059
See merge request GNOME/gtk!6333
2023-08-25 14:34:13 +00:00
Matthias Clasen
c97dc6e903
Merge branch 'conics-revisited' into 'main'
...
path: Switch back to conics
See merge request GNOME/gtk!6332
2023-08-25 14:26:33 +00:00
Matthias Clasen
eec90d1026
pathbuilder: Add rel-variants for arc-to
...
Add rel-variants for all our arc-to APIs. This is
a pretty harmless addition, and it is more consistent
to have these for all ..._to functions.
2023-08-25 09:45:45 -04:00
Matthias Clasen
f4fb4d04e5
Some pathbuilder doc clarifications
...
Mention the end point of the html arc-to call.
2023-08-25 09:37:07 -04:00
Matthias Clasen
3283157352
Bring arc_to back as convenience API
...
It is our main use of conics, so make it an API,
and use it internally.
2023-08-25 09:31:19 -04:00
Sergey Bugaev
d07a6b8566
snapshot, gsktransform: Mention that rotation happens around (0, 0)
...
...and not around the center of the render node, as one could expect
given that the render node syntax for rotation, transform: rotate(90);,
happens to match the CSS syntax for the same thing, and CSS does rotate
around the center by default.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Sergey Bugaev
4e8e59cd58
snapshot: Fix push_repeat () with empty child bounds
...
The logic would confuse empty child bounds (in which case nothing should
get rendered) with NULL child bounds (in which case the child node's own
bounds should get used). In fact, if the child bounds are empty, we can
discard the descendant render nodes completely, getting a nice little
optimization.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Sergey Bugaev
9f811ccee5
testsuite: Add color-matrix-merge testcase
...
This tests the merging of nested color matrix nodes feature of
GtkSnapshot, which was broken before commit 082fdfdb24
.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Sergey Bugaev
6cd6da050b
testsuite: Add render node replay tests
...
This takes a render node tree and "replays" it by using the GtkSnapshot
machinery. We don't necesserily expect to get back an exactly equal
render node tree back, since GtkSnapshot applies various small
optimizations where possible, but the original and the replayed nodes
should render to identical textures.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Matthias Clasen
a906dbea35
demo: Fix a bug without GL
...
The gears widget was just not unrealizing properly
when GL is not available. Fix that.
Fixes : #6059
2023-08-25 08:37:22 -04:00
Matthias Clasen
5bc82f4141
Change curve derivative api
...
We don't need to have the derivative as a curve,
it is enough for us to compute values of the
derivative at a given t, which we can also do
for conics.
2023-08-25 07:33:16 -04:00
Matthias Clasen
25e6231a88
path: Switch back to conics
...
Arcs were appealing, but they have a fatal flaw: we can't
split our arcs without changing the ellipse they trace.
That could be fixed by adding an extra parameter, but then
it is no longer any better than conics.
So switch back to conics, which have the advantage that they
are used elsewhere.
2023-08-25 07:33:16 -04:00
Matthias Clasen
650e4b1920
Merge branch 'matthiasc/for-main' into 'main'
...
path docs: Clarify curvature
See merge request GNOME/gtk!6331
2023-08-24 19:55:36 +00:00
Matthias Clasen
5dc0cbc20f
Expand the path docs a bit
2023-08-24 15:00:14 -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
854c695153
pathpoint docs: Fix a link
...
Links gsk->gtk must be done manually, since we
don't have a dependency.
2023-08-24 13:41:39 -04:00
Matthias Clasen
ebd4ceca15
path docs: Clarify curvature
...
The curvature of lines is zero, not infinite.
2023-08-24 11:15:51 -04:00
Matthias Clasen
d873643407
path docs: Add another illustration
2023-08-24 11:09:28 -04:00
Matthias Clasen
8a789d0234
path docs: Cosmetics
2023-08-24 10:54:23 -04:00
Emmanuele Bassi
286b4cbc72
Merge branch 'macos_ci' into 'main'
...
interim solution for macOS CI
See merge request GNOME/gtk!6274
2023-08-24 14:10:03 +00:00
René de Hesselle
b4428029af
Change workflow to enable MR pipelines
...
This makes it possible to have macOS CI run for everything inside the
main repository and for merge requests.
2023-08-24 15:30:03 +02:00
René de Hesselle
9aeb5be8ad
gdk: Use subpixel_layout on macOS
2023-08-24 15:30:03 +02:00
René de Hesselle
007dd55a71
Re-enable macOS CI on new self-hosted runner
2023-08-24 15:30:03 +02:00
Matthias Clasen
7a05e40ce7
Merge branch 'matthiasc/for-main' into 'main'
...
Add some more arc tests
See merge request GNOME/gtk!6330
2023-08-24 12:20:13 +00:00
Matthias Clasen
8d0654db6b
Add some more arc tests
2023-08-24 07:40:05 -04:00
Matthias Clasen
63d5615fe7
Merge branch 'dboles/issue6001-ShortcutsWindow-programmatic' into 'main'
...
Add API to programmatically build ShortcutsWindow
Closes #6001
See merge request GNOME/gtk!6249
2023-08-24 10:40:34 +00:00
Matthias Clasen
37d18816be
menubutton: Don't assume the root is a window
...
The only thing this assumption does is cause
criticals, so remove it.
Fixes : #6055
2023-08-24 06:30:55 -04:00
Matthias Clasen
f1de7a524c
Merge branch 'matthiasc/for-main' into 'main'
...
demo cosmetics
See merge request GNOME/gtk!6329
2023-08-24 10:17:44 +00:00
Fran Dieguez
644692a2e0
Update Galician translation
2023-08-24 06:19:48 +00:00
Matthias Clasen
da2e8b78c2
Merge branch 'matthiasc/for-main' into 'main'
...
demo cosmetics
See merge request GNOME/gtk!6329
2023-08-24 03:47:00 +00:00
Matthias Clasen
0b5a6ecbff
demos: Cosmetics
2023-08-23 23:20:17 -04:00
Matthias Clasen
9a6aac0459
path spinner demo: Don't crash
2023-08-23 23:18:59 -04:00
Benjamin Otte
8aaecc3416
gltexture: Restore previous GL context
...
Texture downloads can be initiated due to the weirdest reasons - and if
they cause a GL context to be changed, it'd be basically unpredictable
when the GL context changes.
An example is the Cairo renderer - if it needs to draw a GL texture, it
will download it.
Now that no longer changes the GL context.
2023-08-24 05:00:29 +02:00
Matthias Clasen
d3f9b3e28a
Merge branch 'matthiasc/for-main' into 'main'
...
arc: Fix the derivative
See merge request GNOME/gtk!6328
2023-08-24 02:45:58 +00:00
Matthias Clasen
4229a37e90
arc: Fix the derivative
...
Scale the derivative such that computing the arc length
of a unit quarter circle wil produce the expected result
of PI/2.
2023-08-23 22:18:52 -04:00
Matthias Clasen
12297fd88a
arc curve: Simplify derivative
2023-08-23 22:11:22 -04:00
Matthias Clasen
7943610066
curve: Fix arc decomposition
2023-08-23 22:11:15 -04:00
Matthias Clasen
e19246d2db
tests: Include arcs in curve tests
2023-08-23 22:10:51 -04:00
Matthias Clasen
e70117bd9f
Merge branch 'mcatanzaro/#6056' into 'main'
...
notebook: fix critical when switching page
Closes #6056
See merge request GNOME/gtk!6327
2023-08-24 01:09:19 +00:00
Michael Catanzaro
20c4e24b74
notebook: fix critical when switching page
...
It's expected that gtk_widget_get_root() will return NULL if the widget
tree does not contain a root widget. I don't know what that means or why
it happens, but it's true in gnome-control-center's network panel when
displaying the OpenVPN configuration dialog. We need to handle it.
Fixes #6056
2023-08-23 15:51:08 -05:00
Matthias Clasen
3c5efbc77e
Merge branch 'wip/matthiasc/arcs' into 'main'
...
path: Add arcs
See merge request GNOME/gtk!6313
2023-08-23 19:17:01 +00:00
Matthias Clasen
f6c2b6bb88
Make foreach work efficiently with arcs
2023-08-23 14:51:31 -04:00
Matthias Clasen
4ab03e79b7
Drop some unnecessary code
...
We tell path_foreach to split into lines or cubics,
so no point in having code to handle quads and arcs.
2023-08-23 14:33:25 -04:00
Matthias Clasen
7a12abdea3
Incorporate review feedback
2023-08-23 14:16:43 -04:00
Matthias Clasen
36ca1f10dc
Add an arc demo
...
Make a circular spinner to see how well arcs
do for circles.
2023-08-23 13:45:12 -04:00
Matthias Clasen
07a92c1690
Merge branch 'matthiasc/for-main' into 'main'
...
docs: Fix gsk->gtk links
See merge request GNOME/gtk!6324
2023-08-23 16:45:26 +00:00
Matthias Clasen
0f7b9e686c
Add a rounded rect test
...
This checks that our path-in-fill computations
agree with rounded_rect_contains_point. Sadly,
they don't do that, 100%.
2023-08-23 12:43:52 -04:00