[gtk+] scrolledwindow: Remove redundant use of MAX
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] scrolledwindow: Remove redundant use of MAX
- Date: Tue, 17 May 2016 15:27:56 +0000 (UTC)
commit c81cd94b8f450e4e762bc197b4695f90ec08abf7
Author: Debarshi Ray <debarshir gnome org>
Date: Mon May 16 21:50:05 2016 +0200
scrolledwindow: Remove redundant use of MAX
This code tries to add the minimum content size, if one is set, to the
GtkScrolledWindow's size requisition. This is obvious from the check
for non-negative values of min-content-height and min-content-width.
Using MAX needlessly makes the code harder to read by implying that
there is more to it when there actually isn't.
Fall out from 0d9ebb501df60cf1803858efcd1c79542588abd8
https://bugzilla.gnome.org/show_bug.cgi?id=766569
gtk/gtkscrolledwindow.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 884e377..b6100d6 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1757,8 +1757,8 @@ gtk_scrolled_window_measure (GtkCssGadget *gadget,
{
if (priv->min_content_width >= 0)
{
- minimum_req.width = MAX (minimum_req.width, priv->min_content_width);
- natural_req.width = MAX (natural_req.width, priv->min_content_width);
+ minimum_req.width += priv->min_content_width;
+ natural_req.width += priv->min_content_width;
extra_width = -1;
}
else if (policy_may_be_visible (priv->vscrollbar_policy) && !priv->use_indicators)
@@ -1783,8 +1783,8 @@ gtk_scrolled_window_measure (GtkCssGadget *gadget,
{
if (priv->min_content_height >= 0)
{
- minimum_req.height = MAX (minimum_req.height, priv->min_content_height);
- natural_req.height = MAX (natural_req.height, priv->min_content_height);
+ minimum_req.height += priv->min_content_height;
+ natural_req.height += priv->min_content_height;
extra_height = -1;
}
else if (policy_may_be_visible (priv->hscrollbar_policy) && !priv->use_indicators)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]