[X2Go-Commits] [pale-moon] 138/294: The result of adding any percentage factor to a size that is zero should also be zero

git-admin at x2go.org git-admin at x2go.org
Sat Apr 27 08:58:00 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch upstream/28.5.0
in repository pale-moon.

commit 96dfb2e6dfe677c3b79d6fc5710057a848007db1
Author: JustOff <Off.Just.Off at gmail.com>
Date:   Thu Mar 21 21:45:08 2019 +0200

    The result of adding any percentage factor to a size that is zero should also be zero
---
 layout/base/nsLayoutUtils.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h
index 63253fd..0a82dbf 100644
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -1439,13 +1439,14 @@ public:
   /**
    * This function increases an initial intrinsic size, 'aCurrent', according
    * to the given 'aPercent', such that the size-increase makes up exactly
-   * 'aPercent' percent of the returned value.  If 'aPercent' is less than
-   * or equal to zero the original 'aCurrent' value is returned. If 'aPercent'
-   * is greater than or equal to 1.0 the value nscoord_MAX is returned.
+   * 'aPercent' percent of the returned value.  If 'aPercent' or 'aCurrent' are
+   * less than or equal to zero the original 'aCurrent' value is returned.
+   * If 'aPercent' is greater than or equal to 1.0 the value nscoord_MAX is
+   * returned.
    */
   static nscoord AddPercents(nscoord aCurrent, float aPercent)
   {
-    if (aPercent > 0.0f) {
+    if (aPercent > 0.0f && aCurrent > 0) {
       return MOZ_UNLIKELY(aPercent >= 1.0f) ? nscoord_MAX
         : NSToCoordRound(float(aCurrent) / (1.0f - aPercent));
     }

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pale-moon.git


More information about the x2go-commits mailing list