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

Area highlight/select in wrong location when css applied to wrapper #358

Open
techfg opened this issue Jan 29, 2021 · 0 comments
Open

Area highlight/select in wrong location when css applied to wrapper #358

techfg opened this issue Jan 29, 2021 · 0 comments
Labels
Milestone

Comments

@techfg
Copy link
Collaborator

techfg commented Jan 29, 2021

Describe the bug
When applying CSS to the wrapper element of ImageMapster (e.g. via wrapClass, wrapCss, etc.) the highlight/select behavior of ImageMapster results in the wrong area being targeted based on the position of the image itself.

This is occurring because the canvas elements are absolutely positioned at left: 0, top: 0 and do not account for padding that can be applied via CSS to the wrapper.

To Reproduce
Steps to reproduce the behavior:

  1. Open jsFiddle
  2. Hover over the image
  3. Notice that the highlight is 20px to the left and up from where it should be

Expected behavior
The highlight/select should be positioned in the correct location that is reflected in the image itself based on its position

Screenshots
CanvasAbsolutePosition

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
The canvas_style internal variable is hardcoded to absolute/0/0 and either needs to dynamically be adjusted at runtime to account for padding, etc. or made as a configuration option such that there is a way for the user to specify adjustments to correspond to the CSS they are applying to the wrapper.

@techfg techfg added the bug label Jan 29, 2021
@techfg techfg added this to the 2.0.0 milestone Jan 29, 2021
@techfg techfg changed the title Area highlight/select is wrong location when css applied to wrapper Area highlight/select in wrong location when css applied to wrapper Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant