From f89feba680a07ba936fa2c41d3aa1e2e7c849b5c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 12 Jun 2016 16:27:29 -0400 Subject: [PATCH] Included spanning views in hugging priority management. --- darwin/grid.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwin/grid.m b/darwin/grid.m index 369dc94b..8af275f8 100644 --- a/darwin/grid.m +++ b/darwin/grid.m @@ -333,16 +333,16 @@ struct uiGrid { uiDarwinControlSetSuperview(uiDarwinControl(gc.c), self); uiDarwinControlSyncEnableState(uiDarwinControl(gc.c), uiControlEnabledToUser(uiControl(self->g))); - // if a control expands horizontally, it should not hug horizontally + // if a control expands horizontally OR spans horizontally, it should not hug horizontally // otherwise, it should *forcibly* hug - if (gc.hexpand) + if (gc.hexpand || gc.xspan != 1) priority = NSLayoutPriorityDefaultLow; else // LONGTERM will default high work? priority = NSLayoutPriorityRequired; uiDarwinControlSetHuggingPriority(uiDarwinControl(gc.c), priority, NSLayoutConstraintOrientationHorizontal); // same for vertical direction - if (gc.vexpand) + if (gc.vexpand || gc.yspan != 1) priority = NSLayoutPriorityDefaultLow; else // LONGTERM will default high work?