Adrian Johnson [Mon, 26 Nov 2018 09:43:24 +0000 (20:13 +1030)]
Use cairo mime data to allow reduce the file size of cairo output
The cairo image mime types, eg CAIRO_MIME_TYPE_JPEG, allow
applications to attached the original encoded image file. This allows
cairo backends that support the image encoding to embed the encoded
data directly in the ouptut instead of recompressing the image bitmap
with Flate.
The CAIRO_MIME_TYPE_UNIQUE_ID mime type allows applications to assign
a unique identifer to source surfaces. When surfaces with the same
identifer are used multiple times. The backend can, if supported, only
emit one copy of the image data for mupltiple uses.
Adrian Johnson [Sat, 24 Nov 2018 11:38:37 +0000 (22:08 +1030)]
Use cairo mime data to allow reduce the file size of cairo output
The cairo image mime types, eg CAIRO_MIME_TYPE_JPEG, allow
applications to attached the original encoded image file. This allows
cairo backends that support the image encoding to embed the encoded
data directly in the ouptut instead of recompressing the image bitmap
with Flate.
The CAIRO_MIME_TYPE_UNIQUE_ID mime type allows applications to assign
a unique identifer to source surfaces. When surfaces with the same
identifer are used multiple times. The backend can, if supported, only
emit one copy of the image data for mupltiple uses.
Stephen C North [Fri, 9 Nov 2018 12:29:27 +0000 (07:29 -0500)]
added some missing X11 color names found in freedesktop.org
and enable definition of clusters by setting an attribute in
subgraphs instead of relying on subgraph name prefix.
these features still need to be documented.
The case where malloc() returns NULL was not checked, leading to the return
value always being dereferenced.
In libraries, such allocation functions usually just return NULL on failure and
the caller is expected to check the return value before proceeding. This does
not appear to be the case for the graphviz library, which just calls exit(1),
e.g. in agallocu(). While such behavior can unexpectedly exit(1) any program
using this library, I still opted to use exit(1) instead of returning NULL for
consistency, and because some callers in graphviz always expect these functions
to succeed (not checking the return value). It is better to exit with exit(1)
than with a null pointer dereference error, because at least the atexit() and
similar handlers will be run.
1) Center the node's bounding box on the nodes position (in the global coordinate system) based on it's size while being moved. This solves the issue of being unable to click-and-drag a node after it was initially dragged, since the bounding box erroneously remained at the initial position.
2) Keep the relative position offset between the center of the node and the position of the cursor when clicking-and-dragging. This avoid snapping the center of the node to the current cursor position, but rather allows it to move with the cursor.
3) Redraw the graph on 'leftup' to correct nodes that may have become visually corrupted by edges obscuring their outlines.
Stephen C North [Wed, 4 Jul 2018 11:48:35 +0000 (07:48 -0400)]
Copy ac239f71ea9f807590505e6862cebe50e992e271 from gitlab graphviz.
fix for SVG rotation bug, demonstrated by
digraph BadRotation { graph [ rotate = 90]; A -> B ->C ->D ->E; }
fix proposed by steve roush
https://gitlab.com/graphviz/graphviz/issues/1392
Stephen C North [Wed, 4 Jul 2018 11:36:23 +0000 (07:36 -0400)]
Copy patches to migrate gvedit to QT5, from gitlab graphviz 44d64ada7fcee208004ea0df2a822299d424b143 except I left out -fPIC
from cmd/gvedit/Makefile.am because I can hardly comprehend why
this has to be hardwired. This also adds QT5 checks in the top
configure.ac (abandoning QT3 and QT4) and changes
AM_INIT_AUTOMAKE([no-define subdir-objects]) to
AM_INIT_AUTOMAKE([no-define]) which I don't pretend to understand.
Stephen C North [Wed, 4 Jul 2018 11:20:40 +0000 (07:20 -0400)]
Copied 02a820ebdec93aac25e93945b16a6360c6ac7d43 from gitlab graphviz.
This add attribute TBbalance={min,max} to push tree nodes with slack as low or high as possible and sets DPI to 72 instead of 96 for quartz. Hope that's ok.
Philip Pham [Sat, 7 Apr 2018 19:56:26 +0000 (12:56 -0700)]
Include gvcjob.h in gvcint.h
gvcint.h uses gvtextlayout_engine_t which is declared in gvcjob.h.
This means that in order to use gvcint.h, one must include gvcjob.h. This is particularly problematic because gvcint.h comes before gvcjob.h, alphabetically, which leads to a broken build after running an autoformatter.
Thadeus Fleming [Fri, 23 Mar 2018 15:42:25 +0000 (10:42 -0500)]
Prevent exponential growth of length of edges in clusters
`edgelabel_ranks` gets called for the root graph and all of its cluster
subgraphs. It should only double `ED_minlen` for each edge once. Reverting the
test for labeled edges to check only the active graph, rather than its root,
prevents it from expanding the `minlen` once for every level of cluster
containing the edge.
Fix bug in routespl, when the code encounters a degenerate case when trying to reclaim space and thus calls make_polyline. The old code freed the array of points returned, but this array is static in make_polyline and should never be freed.