Skip to content

Only check for moving draggable in canvas renderer when map is draggable#3942

Merged
yohanboniface merged 3 commits intoLeaflet:masterfrom
klaftertief:fix-canvas-move
Oct 15, 2015
Merged

Only check for moving draggable in canvas renderer when map is draggable#3942
yohanboniface merged 3 commits intoLeaflet:masterfrom
klaftertief:fix-canvas-move

Conversation

@klaftertief
Copy link
Copy Markdown
Contributor

This is a fix for #3941

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This becomes a bit hard to follow, I wonder if we should not have a method on the L.Draggable object to make this more readable.
Something like this._map.dragging.moving() that would do both checks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this._map._dragging, inheriting from L.Handler has a enabled() method that should be used here instead of private property.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Should be a simple change, but let's look if we can update similar places to use the new method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I'm happy to update the pull request later.

@yohanboniface
Copy link
Copy Markdown
Member

Good catch! See code comments :)

@yohanboniface yohanboniface added this to the 1.0-beta3 milestone Oct 15, 2015
@klaftertief
Copy link
Copy Markdown
Contributor Author

Ok, I just added a moving() method to the MapDrag handler, just like the moved() method there.
I didn't find any other occurrences of the _moving property, except in the Draggable class itself.

yohanboniface added a commit that referenced this pull request Oct 15, 2015
Only check for moving draggable in canvas renderer when map is draggable
@yohanboniface yohanboniface merged commit c2a3dc9 into Leaflet:master Oct 15, 2015
@klaftertief klaftertief deleted the fix-canvas-move branch October 15, 2015 19:44
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

Successfully merging this pull request may close these issues.

3 participants