diff options
author | David Robillard <d@drobilla.net> | 2025-01-22 18:42:12 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-01-22 18:42:12 -0500 |
commit | 8905c1176aa5099545fd9abb2e673efc136d0311 (patch) | |
tree | 5bc2b2e01d0583147089ca910aac3880b5404089 /src/mac.m | |
parent | 1dce4defe62b5e0ed70460b52c444dc51a701e18 (diff) | |
download | pugl-8905c1176aa5099545fd9abb2e673efc136d0311.tar.gz pugl-8905c1176aa5099545fd9abb2e673efc136d0311.tar.bz2 pugl-8905c1176aa5099545fd9abb2e673efc136d0311.zip |
Rename PuglViewSize to PuglArea
Diffstat (limited to 'src/mac.m')
-rw-r--r-- | src/mac.m | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -345,9 +345,9 @@ dispatchCurrentChildViewConfiguration(PuglView* const view) - (NSSize)intrinsicContentSize { - const PuglViewSize defaultSize = puglview->sizeHints[PUGL_DEFAULT_SIZE]; + const PuglArea defaultSize = puglview->sizeHints[PUGL_DEFAULT_SIZE]; - return puglIsValidSize(defaultSize) + return puglIsValidArea(defaultSize) ? sizePoints(puglview, defaultSize.width, defaultSize.height) : NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric); } @@ -1117,7 +1117,7 @@ updateSizeHint(PuglView* const view, const PuglSizeHint hint) { const PuglSpan width = view->sizeHints[hint].width; const PuglSpan height = view->sizeHints[hint].height; - if (!puglIsValidSize(view->sizeHints[hint])) { + if (!puglIsValidArea(view->sizeHints[hint])) { return PUGL_FAILURE; } @@ -1185,10 +1185,10 @@ getInitialFrame(PuglView* const view) : [screen frame]); // Center the frame around the center of the bounding rectangle - const PuglViewSize defaultSize = view->sizeHints[PUGL_DEFAULT_SIZE]; - const NSRect boundsPx = nsRectFromPoints(view, boundsPt); - const double centerX = boundsPx.origin.x + boundsPx.size.width / 2; - const double centerY = boundsPx.origin.y + boundsPx.size.height / 2; + const PuglArea defaultSize = view->sizeHints[PUGL_DEFAULT_SIZE]; + const NSRect boundsPx = nsRectFromPoints(view, boundsPt); + const double centerX = boundsPx.origin.x + boundsPx.size.width / 2; + const double centerY = boundsPx.origin.y + boundsPx.size.height / 2; const PuglRect frame = {(PuglCoord)(centerX - (defaultSize.width / 2U)), (PuglCoord)(centerY - (defaultSize.height / 2U)), @@ -1272,7 +1272,7 @@ puglRealize(PuglView* view) NSLayoutRelationGreaterThanOrEqual, view->sizeHints[PUGL_MIN_SIZE].height)]; - if (puglIsValidSize(view->sizeHints[PUGL_MAX_SIZE])) { + if (puglIsValidArea(view->sizeHints[PUGL_MAX_SIZE])) { [impl->wrapperView addConstraint:puglConstraint(impl->wrapperView, NSLayoutAttributeWidth, |