diff --git a/VoidLink/Input/PencilHandler.swift b/VoidLink/Input/PencilHandler.swift index 1c8e1b50..cb5de0af 100644 --- a/VoidLink/Input/PencilHandler.swift +++ b/VoidLink/Input/PencilHandler.swift @@ -49,10 +49,15 @@ import UIKit PencilHandler.shared = self } - public func setupPressureLUT(){ - let oscProfileMan = OSCProfilesManager.sharedManager(CGRectZero) - PencilHandler.selectedProfile = oscProfileMan.getSelectedProfile() - guard let selectedProfile = PencilHandler.selectedProfile else {return} + @objc public func setupPressureLUT(profile:OSCProfile? = nil){ + var selectedProfile:OSCProfile + if profile == nil { + let oscProfileMan = OSCProfilesManager.sharedManager(CGRectZero) + selectedProfile = oscProfileMan.getSelectedProfile() + } + else{ + selectedProfile = profile! + } if selectedProfile.eraserShortcut != "" { doubleTapShorcuts.append(selectedProfile.eraserShortcut) diff --git a/VoidLink/Input/StreamView.m b/VoidLink/Input/StreamView.m index 476837de..73be9473 100644 --- a/VoidLink/Input/StreamView.m +++ b/VoidLink/Input/StreamView.m @@ -675,6 +675,10 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5; if([self isOscEnabled]) [self reloadLegacyWidgets:oscProfile]; else [self disableOnScreenControls]; } + + if(reload && !OnScreenWidgetView.editMode){ + [PencilHandler.shared setupPressureLUTWithProfile:oscProfile]; + } }); }