From 6d061ddfa238ad8ca680a40c4188435d8afa0ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Mon, 1 Jul 2019 13:16:21 +0200 Subject: [PATCH] Internal: Revert balloon position calculation changed in the docs update. --- src/panel/balloon/balloonpanelview.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/panel/balloon/balloonpanelview.js b/src/panel/balloon/balloonpanelview.js index 9e6f858e..9633d8b7 100644 --- a/src/panel/balloon/balloonpanelview.js +++ b/src/panel/balloon/balloonpanelview.js @@ -234,7 +234,13 @@ export default class BalloonPanelView extends View { fitInViewport: true }, options ); - const { top, left, name: position } = BalloonPanelView._getOptimalPosition( positionOptions ); + const optimalPosition = BalloonPanelView._getOptimalPosition( positionOptions ); + + // Usually browsers make some problems with super accurate values like 104.345px + // so it is better to use int values. + const left = parseInt( optimalPosition.left ); + const top = parseInt( optimalPosition.top ); + const position = optimalPosition.name; Object.assign( this, { top, left, position } ); }