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

Textboxes sometimes get stuck very small while drawing. #3

Open
justinmanley opened this issue Sep 8, 2014 · 1 comment
Open

Textboxes sometimes get stuck very small while drawing. #3

justinmanley opened this issue Sep 8, 2014 · 1 comment
Assignees
Labels

Comments

@justinmanley
Copy link
Owner

Sometimes, when drawing a textbox, the textbox get stuck at a fixed size while still very small and the map starts to drag. If the user then goes into editing mode, the textbox can be expanded to a usable size - but it's annoying and unintuitive behavior.

This bug can result in lots of textboxes that look like this:

image

It seems that the size of the textbox may be getting set to the textbox minSize. I'm not sure why that fires the draw:created event and enables map dragging again, though.

This bug is present in the demo for version 0.0.2 (http://manleyjster.github.io/Leaflet.Illustrate/examples/0.0.2/simple/), but seems to have become much more pronounced with updates to L.Illustrate.Textbox#setSize in d34ffc706f.

@justinmanley justinmanley self-assigned this Sep 8, 2014
@justinmanley
Copy link
Owner Author

After some testing and experiments, here's what I've concluded:

  • The problem is with instances of L.Rectangle, not L.Illustrate.Textbox, since the boxes get stuck before the draw:created event is fired (and thus before _fireCreatedEvent is called). L.Illustrate.Create.Textbox is designed so that drawing is done with instances of L.Rectangle, and an L.Illustrate.Textbox is not returned until drawing is complete, so this has to be an issue with L.Rectangle.
  • I observed that I sometimes also get this issue with instances of L.Rectangle drawn using L.Draw.Rectangle, which corroborates the hypothesis that the issue lies with L.Rectangle.
  • At the same time, the bug only appears when the L.Illustrate library is loaded and there is an instance of L.Illustrate.Toolbar added to the map. I couldn't get the bug to appear with L.draw alone. This suggests that this is a bug with L.Illustrate.

Questions

Why does this bug only manifest intermittently? It's not an issue with every textbox - just with some. It's seemingly random. Furthermore, this bug occurs at different rates in different environments (it seems to occur less frequently in the version 0.0.2 demo for L.Illustrate than it does for d34ffc706f, and it occurs less frequently with L.Draw.Rectangle than with L.Illustrate.Textbox).

justinmanley added a commit that referenced this issue Sep 8, 2014
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