jenkins-bot has submitted this change and it was merged.

Change subject: Remove use of Math.round() for offset and position pixel values
......................................................................


Remove use of Math.round() for offset and position pixel values

This is just asking for off-by-one clipping errors.

Change-Id: Iaab604e12155e0637695cf0d0846da9e69d96e35
---
M src/Element.js
M src/Window.js
M src/dialogs/MessageDialog.js
M src/widgets/PopupWidget.js
4 files changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/Element.js b/src/Element.js
index f2f8a48..e766b54 100644
--- a/src/Element.js
+++ b/src/Element.js
@@ -234,10 +234,10 @@
                right = parseFloat( style ? style.borderRightWidth : $el.css( 
'borderRightWidth' ) ) || 0;
 
        return {
-               top: Math.round( top ),
-               left: Math.round( left ),
-               bottom: Math.round( bottom ),
-               right: Math.round( right )
+               top: top,
+               left: left,
+               bottom: bottom,
+               right: right
        };
 };
 
diff --git a/src/Window.js b/src/Window.js
index 19564d8..0e4b3ef 100644
--- a/src/Window.js
+++ b/src/Window.js
@@ -348,7 +348,7 @@
                bodyStyleObj.position = oldPosition;
        } );
 
-       return Math.round(
+       return (
                // Add buffer for border
                ( this.$frame.outerHeight() - this.$frame.innerHeight() ) +
                // Use combined heights of children
diff --git a/src/dialogs/MessageDialog.js b/src/dialogs/MessageDialog.js
index 595a53f..f6e92a9 100644
--- a/src/dialogs/MessageDialog.js
+++ b/src/dialogs/MessageDialog.js
@@ -172,7 +172,7 @@
        $scrollable.height();
        $scrollable.contents().show();
 
-       bodyHeight = Math.round( this.text.$element.outerHeight( true ) );
+       bodyHeight = this.text.$element.outerHeight( true );
        $scrollable[0].style.overflow = oldOverflow;
 
        return bodyHeight;
diff --git a/src/widgets/PopupWidget.js b/src/widgets/PopupWidget.js
index 386d07d..3fd7305 100644
--- a/src/widgets/PopupWidget.js
+++ b/src/widgets/PopupWidget.js
@@ -230,8 +230,8 @@
        popupOffset = this.width * ( { left: 0, center: -0.5, right: -1 } 
)[this.align];
 
        // Figure out if this will cause the popup to go beyond the edge of the 
container
-       originOffset = Math.round( this.$element.offset().left );
-       containerLeft = Math.round( this.$container.offset().left );
+       originOffset = this.$element.offset().left;
+       containerLeft = this.$container.offset().left;
        containerWidth = this.$container.innerWidth();
        containerRight = containerLeft + containerWidth;
        popupLeft = popupOffset - this.containerPadding;

-- 
To view, visit https://gerrit.wikimedia.org/r/179494
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaab604e12155e0637695cf0d0846da9e69d96e35
Gerrit-PatchSet: 5
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to