From d88a13fc80c94188ffe66caff1cb68f2c4e076f8 Mon Sep 17 00:00:00 2001 From: danteruiz Date: Tue, 2 Apr 2019 13:28:41 -0700 Subject: [PATCH 1/2] fix keybaord scaling --- interface/src/Application.cpp | 4 +++- interface/src/ui/Keyboard.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8225d27033..f1bbb0ab9e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5847,7 +5847,9 @@ void Application::reloadResourceCaches() { DependencyManager::get()->reloadAllScripts(); getOffscreenUI()->clearCache(); - DependencyManager::get()->createKeyboard(); + auto keyboard = DependencyManager::get(); + keyboard->createKeyboard(); + keyboard->scaleKeyboard(getMyAvatar()->getSensorToWorldScale()); getMyAvatar()->resetFullAvatarURL(); } diff --git a/interface/src/ui/Keyboard.h b/interface/src/ui/Keyboard.h index 51e5e0571f..2b6829bf2b 100644 --- a/interface/src/ui/Keyboard.h +++ b/interface/src/ui/Keyboard.h @@ -98,6 +98,7 @@ public: bool isPassword() const; void setPassword(bool password); void enableRightMallet(); + void scaleKeyboard(float sensorToWorldScale); void enableLeftMallet(); void disableRightMallet(); void disableLeftMallet(); @@ -122,7 +123,6 @@ public slots: void handleTriggerContinue(const QUuid& id, const PointerEvent& event); void handleHoverBegin(const QUuid& id, const PointerEvent& event); void handleHoverEnd(const QUuid& id, const PointerEvent& event); - void scaleKeyboard(float sensorToWorldScale); private: struct Anchor { From 5f5e7d5f4e9b4f7fb716dedb0ba80eac04f66d43 Mon Sep 17 00:00:00 2001 From: danteruiz Date: Wed, 3 Apr 2019 10:45:40 -0700 Subject: [PATCH 2/2] a better fix --- interface/src/Application.cpp | 4 +--- interface/src/ui/Keyboard.cpp | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f1bbb0ab9e..8225d27033 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5847,9 +5847,7 @@ void Application::reloadResourceCaches() { DependencyManager::get()->reloadAllScripts(); getOffscreenUI()->clearCache(); - auto keyboard = DependencyManager::get(); - keyboard->createKeyboard(); - keyboard->scaleKeyboard(getMyAvatar()->getSensorToWorldScale()); + DependencyManager::get()->createKeyboard(); getMyAvatar()->resetFullAvatarURL(); } diff --git a/interface/src/ui/Keyboard.cpp b/interface/src/ui/Keyboard.cpp index 1cbe31f1eb..6262210620 100644 --- a/interface/src/ui/Keyboard.cpp +++ b/interface/src/ui/Keyboard.cpp @@ -910,6 +910,9 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) { }); _layerIndex = 0; addIncludeItemsToMallets(); + + auto myAvatar = DependencyManager::get()->getMyAvatar(); + scaleKeyboard(myAvatar->getSensorToWorldScale()); }); request->send();