How to find leftmost/rightmost point of SVG C (bezier curve) path segment? I know there is getBoundingClientRect()
and getBBox()
but none of them apply since they return only single coordinate of the point.
Just to avoid XY problem - I want to split single path composed of bezier curves into several paths each monotonously going from left to right (or right to left). It means that on any single path should be no 2 points having equal X coordinate. I understand that required split point may potentially be inside the bounding box of a segment thus not being leftmost/rightmost, but I'm almost sure that way of finding such point should use same techniques as finding horizontally extreme point.
getBBpox(0
returns a "single point"?getBBox()
returns the bounding box of the path. The leftmost point should bebbox.x
and the rightmost should bebbox.x + bbox.width
. Is that what you wanted? – Paul LeBeaugetBBox
can let me knowx
coordinate of the target point, but noty
. This is what I mean when say only single coordinate. – Vasily Liaskovsky