Only check segments for miters that are within the limit.
Fix wrong calculation of rough bounds for square caps.

And add some comments to stroke hit-testing code.