The zoom behavior is applied to an invisible rect overlaying the SVG
element; this ensures that it receives input, and that the pointer
coordinates are not affected by the zoom behavior’s transform.
There were several problems:
The overlay rect was a child of the g that was transformed.
The zoom behavior was not attached to the rect, but to the g.
The rect was not positioned correctly after applying fixes for 1
and 2.
Coverage remained the same at 97.63% when pulling 663eee76ff0bf2d43d073ddf9fb170338e87cbaf on magjac:master into d07d793aab5507f7bb6329aa1ff08d76a71a4015 on mstefaniuk:master.
From https://bl.ocks.org/mbostock/4e3925cdc804db257a86fdef3a032a45:
The zoom behavior is applied to an invisible rect overlaying the SVG element; this ensures that it receives input, and that the pointer coordinates are not affected by the zoom behavior’s transform.
There were several problems: