Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify set_size on macOS (#393)
  • Loading branch information
rajivshah3 committed Jun 20, 2020
1 parent 047d561 commit 23336a0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions webview.h
Expand Up @@ -672,18 +672,12 @@ class cocoa_wkwebview_engine {
}
objc_msgSend(m_window, "setStyleMask:"_sel, style);

struct {
CGFloat width;
CGFloat height;
} size;
if (hints == WEBVIEW_HINT_MIN) {
size.width = width;
size.height = height;
objc_msgSend(m_window, "setContentMinSize:"_sel, size);
objc_msgSend(m_window, "setContentMinSize:"_sel,
CGSizeMake(width, height));
} else if (hints == WEBVIEW_HINT_MAX) {
size.width = width;
size.height = height;
objc_msgSend(m_window, "setContentMaxSize:"_sel, size);
objc_msgSend(m_window, "setContentMaxSize:"_sel,
CGSizeMake(width, height));
} else {
objc_msgSend(m_window, "setFrame:display:animate:"_sel,
CGRectMake(0, 0, width, height), 1, 0);
Expand Down

0 comments on commit 23336a0

Please sign in to comment.