From 14e0716696ee396a36d395b4d0f2c1c0e69a1860 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sun, 21 Jul 2019 13:46:54 +0200 Subject: [PATCH] remove objc references from ui task lambda --- PanoPainter/GameViewController.m | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/PanoPainter/GameViewController.m b/PanoPainter/GameViewController.m index 9dd5ea6..23dc1ee 100644 --- a/PanoPainter/GameViewController.m +++ b/PanoPainter/GameViewController.m @@ -240,10 +240,9 @@ std::recursive_mutex lock_mutex; frame.size.height -= kbSize.height; view.frame = frame; - App::I->ui_task_async([=] + App::I->ui_task_async([size=frame.size, f=self.view.contentScaleFactor] { - App::I->resize(frame.size.width * view.contentScaleFactor, - frame.size.height * view.contentScaleFactor); + App::I->resize(size.width * f, size.height * f); }); App::I->animate = false; } @@ -253,10 +252,9 @@ std::recursive_mutex lock_mutex; { CGRect frame = [[UIScreen mainScreen] bounds]; self.view.frame = frame; - App::I->ui_task_async([=] + App::I->ui_task_async([size=frame.size, f=self.view.contentScaleFactor] { - App::I->resize(frame.size.width * self.view.contentScaleFactor, - frame.size.height * self.view.contentScaleFactor); + App::I->resize(size.width * f, size.height * f); }); App::I->animate = true; } @@ -400,10 +398,9 @@ std::set ignored_touch; - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - App::I->ui_task_async([=] + App::I->ui_task_async([f=self.view.contentScaleFactor, size] { - App::I->resize(size.width * self.view.contentScaleFactor, - size.height * self.view.contentScaleFactor); + App::I->resize(size.width * f, size.height * f); }); }