mirror of
https://github.com/taigrr/wails.git
synced 2026-04-12 18:11:31 -07:00
Compare commits
1 Commits
obfuscatio
...
mac-scalin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1290ca92b |
@@ -2042,6 +2042,14 @@ struct webview_priv
|
|||||||
objc_setAssociatedObject(w->priv.delegate, "webview", (id)(w),
|
objc_setAssociatedObject(w->priv.delegate, "webview", (id)(w),
|
||||||
OBJC_ASSOCIATION_ASSIGN);
|
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);
|
NSRect r = NSMakeRect(0, 0, w->width, w->height);
|
||||||
NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
|
NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
|
||||||
NSWindowStyleMaskMiniaturizable;
|
NSWindowStyleMaskMiniaturizable;
|
||||||
@@ -2098,6 +2106,7 @@ struct webview_priv
|
|||||||
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||||
w->priv.webview.frameLoadDelegate = w->priv.delegate;
|
w->priv.webview.frameLoadDelegate = w->priv.delegate;
|
||||||
w->priv.webview.UIDelegate = 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 contentView] addSubview:w->priv.webview];
|
||||||
[w->priv.window orderFrontRegardless];
|
[w->priv.window orderFrontRegardless];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user