Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
Move _containerLeft init before transform (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
fnicollet authored and hyperknot committed Jun 28, 2016
1 parent 74c321f commit 2254d34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/layer/Popup.js
Expand Up @@ -363,6 +363,9 @@ L.Popup = L.Layer.extend({
offset = L.point(this.options.offset),
anchor = this._getAnchor();

var bottom = this._containerBottom = -offset.y,
left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;

if (this._zoomAnimated) {
if (this._map._rotate) {
// rotation relative to the marker's anchor
Expand All @@ -375,9 +378,6 @@ L.Popup = L.Layer.extend({
offset = offset.add(pos).add(anchor);
}

var bottom = this._containerBottom = -offset.y,
left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;

// bottom position the popup in case the height of the popup changes (images loading etc)
this._container.style.bottom = bottom + 'px';
this._container.style.left = left + 'px';
Expand Down

0 comments on commit 2254d34

Please sign in to comment.