Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport for SvgSelector #445

Open
mk-pmb opened this issue Nov 5, 2021 · 0 comments
Open

Viewport for SvgSelector #445

mk-pmb opened this issue Nov 5, 2021 · 0 comments

Comments

@mk-pmb
Copy link

mk-pmb commented Nov 5, 2021

Hi! I'm building an annotation editor. When faced with an SvgSelector whose outermost <svg> tag lacks a width= and/or height= attribute, my understanding of the SVG standard is that the lacking attribute means 100% of the viewport. What is the viewport of an SvgSelector?

Using the working area of the annotation editor doesn't make much sense, as it most certainly differs from the one used by the annotation's author.

My intuition would be to use the target image as the viewport, but I can't find hard arguments for that.

Or should I understand

The dimensions of the SVG shape or canvas MUST be relative to the dimensions of the Source resource,

as to contrive a viewport that whose aspect ratio equals that of the target image, in order to make the next part

such that scaling the shape's size to the full size of the image correctly describes the desired area.

a no-op for the 100% axis/axes? (In case both axes are 100%, can I pick any positive length as width?)

The plus side of this would be to allow for clever trickery (example) that allows changing the target image's aspect ratio after the fact, because using the aspect ratio at time of display will auto-fit the "missing" dimension to the current size of the target image.
However, it feels a bit odd to introduce early scaling calculations just to thwart a later scaling step mandated by the anno model.

The downside of using the target image, or a contrived canvas based on it, as the viewport, would be that the SVG selector cannot be displayed correctly without downloading the target image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant