From d3b18e145b207af2044fb6f04191f9654e1123ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Apr 2016 17:05:18 +0200 Subject: [PATCH] Platform: oops, committed too fast. --- src/Magnum/Platform/Sdl2Application.cpp | 4 ++-- src/Magnum/Platform/Sdl2Application.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 0e8a1dcea..18c14eb4e 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -386,12 +386,12 @@ void Sdl2Application::mainLoop() { #ifndef CORRADE_TARGET_EMSCRIPTEN case SDL_TEXTINPUT: { - TextInputEvent e{event.text.text}; + TextInputEvent e{{event.text.text, std::strlen(event.text.text)}}; textInputEvent(e); } break; case SDL_TEXTEDITING: { - TextEditingEvent e{event.edit.text, event.edit.start, event.edit.length}; + TextEditingEvent e{{event.edit.text, std::strlen(event.text.text)}, event.edit.start, event.edit.length}; textEditingEvent(e); } break; #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 714e607ea..38e92bd52 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -31,6 +31,7 @@ #include #include +#include #include #include "Magnum/Magnum.h" @@ -1230,7 +1231,7 @@ class Sdl2Application::TextInputEvent { constexpr Containers::ArrayView text() const { return _text; } private: - constexpr TextInputEvent(Containers::ArrayView text): _text{text} {} + constexpr TextInputEvent(Containers::ArrayView text): _text{text}, _accepted{false} {} Containers::ArrayView _text; bool _accepted; @@ -1281,7 +1282,7 @@ class Sdl2Application::TextEditingEvent { constexpr Int length() const { return _length; } private: - constexpr TextEditingEvent(Containers::ArrayView text, Int start, Int length): _text{text}, _start{start}, _length{length} {} + constexpr TextEditingEvent(Containers::ArrayView text, Int start, Int length): _text{text}, _start{start}, _length{length}, _accepted{false} {} Containers::ArrayView _text; Int _start, _length;