fix zoom detection issue in old OSX versions
This commit is contained in:
@@ -467,7 +467,9 @@
|
||||
view = [[View alloc] initWithFrame:r];
|
||||
controller = [[Controller alloc] initWithWindow:window];
|
||||
App::I->osx_view = view;
|
||||
App::I->zoom = Settings::value_or<Serializer::Float>("ui-scale", (float)view.layer.contentsScale);
|
||||
|
||||
float z = (float)window.backingScaleFactor;
|
||||
App::I->zoom = Settings::value_or<Serializer::Float>("ui-scale", (z > 0.f) ? z : 1.f);
|
||||
|
||||
auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask|NSClosableWindowMask;
|
||||
window = [[Window alloc] initWithContentRect:r styleMask:style backing:NSBackingStoreBuffered defer:NO];
|
||||
|
||||
@@ -41,6 +41,13 @@ bool App::clipboard_set_text(const std::string& s)
|
||||
#endif
|
||||
}
|
||||
|
||||
void App::stacktrace()
|
||||
{
|
||||
#if __OSX__
|
||||
NSString* callstack = [[NSThread callStackSymbols] componentsJoinedByString:@"\n"];
|
||||
LOG("callstack:\n%s", [callstack cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
#endif
|
||||
}
|
||||
|
||||
void App::crash_test()
|
||||
{
|
||||
|
||||
@@ -1248,7 +1248,7 @@ void App::initLayout()
|
||||
};
|
||||
|
||||
layout.on_loaded = [&] (bool reloaded) {
|
||||
LOG("initializing layout updating after load");
|
||||
LOG("initializing layout updating after load %d x %d zoom %f", (int)width, (int)height, zoom);
|
||||
layout[main_id]->update(width, height, zoom);
|
||||
|
||||
LOG("initializing layout components");
|
||||
|
||||
@@ -621,6 +621,7 @@ void NodeCanvas::reset_camera()
|
||||
void NodeCanvas::create_buffers()
|
||||
{
|
||||
auto new_size = GetSize() * m_density;
|
||||
LOG("NodeCanvas::create_buffers size: %d x %d density %f", (int)new_size.x, (int)new_size.y, m_density);
|
||||
m_canvas->m_mixer.create((int)new_size.x * m_canvas->m_mixer_scale,
|
||||
(int)new_size.y * m_canvas->m_mixer_scale, -1, GL_RGBA8);
|
||||
m_blender_rtt.create((int)new_size.x, (int)new_size.y, -1, GL_RGBA8);
|
||||
|
||||
Reference in New Issue
Block a user