aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/mac.m')
-rw-r--r--src/mac.m7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mac.m b/src/mac.m
index ef0a730..1683a05 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -343,7 +343,7 @@ dispatchCurrentChildViewConfiguration(PuglView* const view)
{
const PuglViewSize defaultSize = puglview->sizeHints[PUGL_DEFAULT_SIZE];
- return (defaultSize.width && defaultSize.height)
+ return puglIsValidSize(defaultSize)
? sizePoints(puglview, defaultSize.width, defaultSize.height)
: NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
}
@@ -1083,7 +1083,7 @@ updateSizeHint(PuglView* const view, const PuglSizeHint hint)
{
const PuglSpan width = view->sizeHints[hint].width;
const PuglSpan height = view->sizeHints[hint].height;
- if (!width || !height) {
+ if (!puglIsValidSize(view->sizeHints[hint])) {
return PUGL_FAILURE;
}
@@ -1238,8 +1238,7 @@ puglRealize(PuglView* view)
NSLayoutRelationGreaterThanOrEqual,
view->sizeHints[PUGL_MIN_SIZE].height)];
- if (view->sizeHints[PUGL_MAX_SIZE].width &&
- view->sizeHints[PUGL_MAX_SIZE].height) {
+ if (puglIsValidSize(view->sizeHints[PUGL_MAX_SIZE])) {
[impl->wrapperView
addConstraint:puglConstraint(impl->wrapperView,
NSLayoutAttributeWidth,