-
Notifications
You must be signed in to change notification settings - Fork 283
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
Refactor image border drawing (css border is affected by image transparency) #6
Comments
Jeff - I think that we're beginning to push the boundaries of what this plugin is for. An "isolate" tool doesn't seem appropriate for this plugin, because it requires that the plugin have knowledge of all of the images that are currently on the map. That's not library code, that's application code. I think the right place for that code is the MapKnitter module in the annotation-interface branch of my fork, or other similar MapKnitter-specific JavaScript code. |
that seems reasonable to me; the same might be said for the hotkeys system; although in both cases, perhaps some of that code could also be provided in code in the examples folder, since they are both extremely useful tools for working with complex maps with multiple images. If you like that idea, we could make a new issue listing things we'd like to move to the /examples/ section and/or excise from the code in favor of an application-specific implementation. |
Sure, good idea - I think the examples are a great place for that code.
|
We could have an outer |
Trying to solve it with just css made borders disappear (as you mentioned). What you propose sounds like a great idea. |
@jywarren I saw that this issue is referenced in some other issues and also commits. Can you please update the issue or open a new issue if we have more work to do here with a clear goal? Thanks! |
I think the best approach may really be to use a Leaflet polygonal layer to draw a polygon just in front of or behind the image, and to just keep updating it as we do the image itself. This would also enable us to do other things like offset or expand it, and it also wouldn't be affected by the distortion - i.e. edges would have a fixed pixel width instead of the longer edges getting fatter. |
@sashadev-sky Should we close this, then? |
No I never solved this actually. I put it under the pending list in my PR. The thing is the border just experiences the same kind of stretching that the image does when you drag a corner too far in one direction. The transparency part is simple to resolve but implementing polylines that dynamically update to make sure they don't distort will be a little project. I'm deleting my comment on here about it and my reference to it in multiple image select so there's no confusion about its status |
transferring my initial notes on it from the pending section of that PR:
|
so we can't use opacity to make images outlined; we may have to draw a new polygon in the way Leaflet implements Polygon?
or we could ditch outlining and create a new tool like "isolate" which would hide all other images besides the one you're working on. Which may be more helpful than outline in the first place.and hide, i guessAlso: a solution here may also solve the issue that extreme distortions reveal that a 1px border is relative to the local image distortions; that is, a highly stretched corner of an image will have a blurry, wider red border.
The text was updated successfully, but these errors were encountered: