Skip to content

graph: Allocate proper size to nodes when zoomed

Tom Wagner requested to merge fix-zooming-allocation into main

Previously, the allocated height and width to a node on the graph was divided by the zoom factor, to account for the changed size from them being zoomed.

To zoom each node, we size_allocate it with a GskTransform that scales it.

However, using a scaling transform to allocate the node already takes care of scaling the height and width, so us also scaling the height and width manually means we were overcompensating.

This resulted in the allocation becoming to big when zooming out, and to small when zooming in.

This is observable as labels will become smaller when zooming in and ellipsize their content.

The commit removes the extra manual scaling so nodes get allocated properly when zoomed.

Fixes #82 (closed).

Merge request reports