Compare commits

...

3 Commits

Author SHA1 Message Date
Lea Anthony
e1290ca92b experiment with scaling factor 2020-10-26 20:04:09 +11:00
Lea Anthony
c49192e847 Merge branch 'develop' of github.com:wailsapp/wails into develop 2020-10-26 20:00:48 +11:00
Lea Anthony
8f6275721a Update contributors 2020-10-26 18:43:47 +11:00
2 changed files with 10 additions and 0 deletions

View File

@@ -37,3 +37,4 @@ Wails is what it is because of the time and effort given by these great people.
* [Ilgıt Yıldırım](https://github.com/ilgityildirim)
* [Altynbek](https://github.com/gelleson)
* [Kyle](https://github.com/kmuchmore)
* [Balakrishna Prasad Ganne](https://github.com/aayush420)

View File

@@ -2042,6 +2042,14 @@ struct webview_priv
objc_setAssociatedObject(w->priv.delegate, "webview", (id)(w),
OBJC_ASSOCIATION_ASSIGN);
CGFloat scale = [[NSScreen mainScreen] backingScaleFactor];
printf("Scale is: %f\n", scale);
if( scale != 1.0f ) {
w->width = w->width / scale;
w->height = w->height / scale;
}
NSRect r = NSMakeRect(0, 0, w->width, w->height);
NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
NSWindowStyleMaskMiniaturizable;
@@ -2098,6 +2106,7 @@ struct webview_priv
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
w->priv.webview.frameLoadDelegate = w->priv.delegate;
w->priv.webview.UIDelegate = w->priv.delegate;
[w->priv.webview.scrollView setZoomScale:1.0/scale animated:NO];
[[w->priv.window contentView] addSubview:w->priv.webview];
[w->priv.window orderFrontRegardless];