SVG icon indicating copy to clipboard operation
SVG copied to clipboard

Add BoundsRelativeToTop

Open Happypig375 opened this issue 3 years ago • 10 comments

What does this implement/fix? Explain your changes.

There is currently no way to obtain the bounds of an element relative to the whole document instead of relative to the parent. This PR adds that.

Happypig375 avatar Jan 22 '22 16:01 Happypig375

What benefits does this PR have for users ?

H1Gdev avatar Jan 24 '22 01:01 H1Gdev

It can determine where to overlay HTML elements over SVG (input boxes), or determine collisions between elements given changing transforms and coordinates.

Happypig375 avatar Jan 25 '22 06:01 Happypig375

This is a behavior I have to emulate myself by applying parent transforms to the bounds myself, by the way.

Happypig375 avatar Jan 30 '22 15:01 Happypig375

Can you give us concrete examples ? We can not determine if this PR needs to be merged...

H1Gdev avatar Jan 31 '22 08:01 H1Gdev

@Happypig375 Please explain the need for this feature. It is mostly GraphicsPath based operations, can this be implemented as extension method?

paulushub avatar Dec 28 '23 12:12 paulushub

@paulushub - I would rely on @H1Gdev to review this - I don't really have the inside to say if this is helpful.

mrbean-bremen avatar Jan 20 '24 19:01 mrbean-bremen

@paulushub - I would rely on @H1Gdev to review this - I don't really have the inside to say if this is helpful.

Testing it now, having merged it into develop branch of my fork. You can checkout my branch, flip between master/develop and see the difference. So far, it is a useful contribution. Using the quick test-run dialog I submitted in my PR, this PR already resolved 3 of the 8 exceptions still in the W3C Test Suite (those failing). So the enhancements to the bounding box computation is useful, with no breaking change so-far, that was why I requested your review.

In fact, I am currently improving the quick test-run dialog to better compare before and after PR changes in the tests.

paulushub avatar Jan 20 '24 20:01 paulushub

Well, that looks like you have sufficiently reviewed it yourself! Just go ahead in this case...

mrbean-bremen avatar Jan 20 '24 21:01 mrbean-bremen

I originally wanted to implement clickable buttons given an area inside the SVG. I later wrote this as an extension method in my code.

Happypig375 avatar Feb 12 '24 04:02 Happypig375

I originally wanted to implement clickable buttons given an area inside the SVG. I later wrote this as an extension method in my code.

Thanks so much for the updates. The PR will still be around as we learn what to include.

paulushub avatar Feb 12 '24 06:02 paulushub