emigre / openseadragon-annotations

Draw annotations over deep zoom images
BSD 3-Clause "New" or "Revised" License
97 stars 39 forks source link

Keep stroke size constant when zooming in #4

Closed j-hudecek closed 8 years ago

j-hudecek commented 8 years ago

When I zoom in and start drawing, the resulting SVG path has stroke-width 0.5 so it's YUGE

openseadragon-anno2

emigre commented 8 years ago

To be honest when I was working on it I did this on purpose, my impression was that it looked better if the stroke was getting better and smaller with the image. But I see now from you using it how the stroke size at that zoom level makes is actually annoying. I'll take a look at your fix and merge it as soon as I have some time

emigre commented 8 years ago

Isn't this issue the same as #6 ?

j-hudecek commented 8 years ago

Well one is that when you draw when zoomed in it appears too big and the other that when you draw zoomed out and then you zoom in it is too big. So the code has to adjust stroke-width based on zoom level and on zoom event the code has to change stroke-width of existing paths.

emigre commented 8 years ago

:thumbsup:

emigre commented 8 years ago

Fixed in 1.0.0

emigre commented 8 years ago

Reopening, as 'vector-effect': 'non-scaling-stroke' won't work in Internet Explorer: StackOverflow - SVG, vector-effect=“non-scaling-stroke” and IE

emigre commented 8 years ago

Fixed in 1.0.1 by setting a different stroke-width depending on the zoom level. Which is a pity, because it's less performant than vector-effect: 'non-scaling-stroke'. As soon as non-scaling-stroke is supported by every major browser it would be great to go back to it, as it's a way better solution than setting the width with JavaScript.

emigre commented 8 years ago

See Microsoft Edge and Internet Explorer Home - Feature Request - SVG non-scaling-stroke (closed as 'Won't Fix').