From 6d36219e884f5d29226d809a62e6353006363284 Mon Sep 17 00:00:00 2001 From: True Zhuanjia Date: Tue, 24 Feb 2026 19:47:20 +0800 Subject: [PATCH] - fixed: unable to setup updated pressure curve mapping after switching widget profile during streaming --- VoidLink/Input/PencilHandler.swift | 13 +++++++++---- VoidLink/Input/StreamView.m | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) 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]; + } }); }