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

Overlay off when OSD viewport margins set? #9

Closed
friarpat opened this issue Sep 2, 2015 · 2 comments
Closed

Overlay off when OSD viewport margins set? #9

friarpat opened this issue Sep 2, 2015 · 2 comments

Comments

@friarpat
Copy link

friarpat commented Sep 2, 2015

Not certain if this applies to svg-overlay or OpenSeaDragon.

I'm using svg-overlay to provide a border around the currently hovered image. All was working well, but I noticed the border was slightly hidden on the left of images (and on the right of images) when I hit the home button on OSD. I set the viewportMargins option on the OSD viewer to have a left and right margin of 2. Border now shows properly in the X direction, but the Y is too "low". In Firebug, I can adjust the y parameter of the "g transform="translate(x, y) scale(blah) element to raise the border to the right location. I can also take the other route of reducing the Y of the rectangle that is a child of the "g" element. The outline has the correct width/height - it's just misplaced in the Y direction.

I see there is a getBoundsWithMargins for the OSD viewport, but not for the tiledImage. I'm using the tiledImage.getBounds call to get the size of the border along with the x/y to get the top/left of the rectangle.

Do I need to do something with the svg-overlay to fix this, or do I need to do something on the OSD side to account for the margins? There is probably some calculation I can perform to get the correct Y coordinate when using margins - but I'm not seeing it.

Thanks!

@friarpat
Copy link
Author

friarpat commented Sep 2, 2015

My bad - I should have looked at the right side of things when I Home view and left/right margins defined. On the right side, the overlay is off in both the x and y directions...left is off just in the Y direction (most likely because X is 0)

iangilman added a commit that referenced this issue Sep 2, 2015
Fixed: overlay off when OSD viewport margins set (#9)
@iangilman
Copy link
Member

Good catch! I've just checked in a fix. :)

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

2 participants