Package org.gnome.gsk

Class PathBuilder

java.lang.Object
All Implemented Interfaces:
Proxy

@Generated("io.github.jwharm.JavaGI") public class PathBuilder extends ProxyInstance
GskPathBuilder is an auxiliary object for constructing GskPath objects.

A path is constructed like this:

GskPath *
 construct_path (void)
 {
   GskPathBuilder *builder;

   builder = gsk_path_builder_new ();

   // add contours to the path here

   return gsk_path_builder_free_to_path (builder);
 }

Adding contours to the path can be done in two ways. The easiest option is to use the gsk_path_builder_add_* group of functions that add predefined contours to the current path, either common shapes like addCircle(org.gnome.graphene.Point, float) or by adding from other paths like addPath(org.gnome.gsk.Path).

The gsk_path_builder_add_* methods always add complete contours, and do not use or modify the current point.

The other option is to define each line and curve manually with the gsk_path_builder_*_to group of functions. You start with a call to moveTo(float, float) to set the starting point and then use multiple calls to any of the drawing functions to move the pen along the plane. Once you are done, you can call close() to close the path by connecting it back with a line to the starting point.

This is similar to how paths are drawn in Cairo.

Note that GskPathBuilder will reduce the degree of added Bézier curves as much as possible, to simplify rendering.