@@ -72,58 +72,58 @@ void DevTools::setupPlatform() {
7272#ifdef GEODE_IS_MOBILE
7373
7474class DevToolsIMEDelegate : public CCIMEDelegate {
75- protected:
76- bool m_attached = false ;
77- std::string m_text;
78- public:
79- bool attachWithIME () override {
80- if (CCIMEDelegate::attachWithIME ()) {
81- // being anywhere but end of line ends up messing up the text, so this sends it to the end of the line
82- #ifdef GEODE_IS_ANDROID
83- ImGui::GetIO ().AddKeyEvent (ImGuiKey_End, true );
84- ImGui::GetIO ().AddKeyEvent (ImGuiKey_End, false );
85- #endif
86- m_attached = true ;
87- CCEGLView::get ()->setIMEKeyboardState (true );
88- return true ;
89- }
90- return false ;
91- }
92-
93- bool detachWithIME () override {
94- if (CCIMEDelegate::detachWithIME ()) {
95- m_attached = false ;
96- CCEGLView::get ()->setIMEKeyboardState (false );
97- ImGui::ClearActiveID ();
98- return true ;
99- }
100- return false ;
101- }
75+ protected:
76+ bool m_attached = false ;
77+ std::string m_text;
78+ public:
79+ bool attachWithIME () override {
80+ if (CCIMEDelegate::attachWithIME ()) {
81+ // being anywhere but end of line ends up messing up the text, so this sends it to the end of the line
82+ #ifdef GEODE_IS_ANDROID
83+ ImGui::GetIO ().AddKeyEvent (ImGuiKey_End, true );
84+ ImGui::GetIO ().AddKeyEvent (ImGuiKey_End, false );
85+ #endif
86+ m_attached = true ;
87+ CCEGLView::get ()->setIMEKeyboardState (true );
88+ return true ;
89+ }
90+ return false ;
91+ }
92+
93+ bool detachWithIME () override {
94+ if (CCIMEDelegate::detachWithIME ()) {
95+ m_attached = false ;
96+ CCEGLView::get ()->setIMEKeyboardState (false );
97+ ImGui::ClearActiveID ();
98+ return true ;
99+ }
100+ return false ;
101+ }
102102
103- bool canAttachWithIME () override {
104- return true ;
105- }
103+ bool canAttachWithIME () override {
104+ return true ;
105+ }
106106
107- bool canDetachWithIME () override {
108- return true ;
109- }
107+ bool canDetachWithIME () override {
108+ return true ;
109+ }
110110
111- char const * getContentText () override {
112- m_text = " " ;
113- for (auto str : ImGui::GetInputTextState (ImGui::GetFocusID ())->TextA ) {
114- m_text += str;
115- }
116- return m_text.c_str ();
117- }
111+ char const * getContentText () override {
112+ m_text = " " ;
113+ for (auto str : ImGui::GetInputTextState (ImGui::GetFocusID ())->TextA ) {
114+ m_text += str;
115+ }
116+ return m_text.c_str ();
117+ }
118118
119- bool isAttached () {
120- return m_attached;
121- }
119+ bool isAttached () {
120+ return m_attached;
121+ }
122122
123- static DevToolsIMEDelegate* get () {
124- static DevToolsIMEDelegate* instance = new DevToolsIMEDelegate ();
125- return instance;
126- }
123+ static DevToolsIMEDelegate* get () {
124+ static DevToolsIMEDelegate* instance = new DevToolsIMEDelegate ();
125+ return instance;
126+ }
127127};
128128
129129#endif
@@ -393,7 +393,7 @@ class $modify(CCTouchDispatcher) {
393393 touch->m_point = pos;
394394 if (type == CCTOUCHBEGAN) {
395395 // makes the start location in the touch correct
396- touch->m_startPoint = CCPoint{ pos. x , pos. y } ;
396+ touch->m_startPoint = pos;
397397 }
398398 CCTouchDispatcher::touches (touches, event, type);
399399
0 commit comments