mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 10:20:07 +00:00
path-tool: Add length to info output
This requires GskPathMeasure.
This commit is contained in:
parent
32d00ca9ed
commit
81c8d1dd28
@ -89,6 +89,7 @@ do_info (int *argc, const char ***argv)
|
||||
{ NULL, },
|
||||
};
|
||||
GskPath *path;
|
||||
GskPathMeasure *measure;
|
||||
graphene_rect_t bounds;
|
||||
|
||||
g_set_prgname ("gtk4-path-tool info");
|
||||
@ -114,6 +115,7 @@ do_info (int *argc, const char ***argv)
|
||||
}
|
||||
|
||||
path = get_path (args[0]);
|
||||
measure = gsk_path_measure_new (path);
|
||||
|
||||
if (gsk_path_is_empty (path))
|
||||
g_print ("%s\n", _("Path is empty."));
|
||||
@ -124,6 +126,8 @@ do_info (int *argc, const char ***argv)
|
||||
if (gsk_path_is_closed (path))
|
||||
g_print ("%s\n", _("Path is closed"));
|
||||
|
||||
g_print ("%s %g\n", _("Path length"), gsk_path_measure_get_length (measure));
|
||||
|
||||
if (gsk_path_get_bounds (path, &bounds))
|
||||
g_print ("%s: %g %g %g %g\n", _("Bounds"),
|
||||
bounds.origin.x, bounds.origin.y,
|
||||
|
Loading…
Reference in New Issue
Block a user