Browse Source

Platform: oops, committed too fast.

pull/183/head^2
Vladimír Vondruš 10 years ago
parent
commit
d3b18e145b
  1. 4
      src/Magnum/Platform/Sdl2Application.cpp
  2. 5
      src/Magnum/Platform/Sdl2Application.h

4
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

5
src/Magnum/Platform/Sdl2Application.h

@ -31,6 +31,7 @@
#include <memory>
#include <Corrade/Corrade.h>
#include <Corrade/Containers/ArrayView.h>
#include <Corrade/Containers/EnumSet.h>
#include "Magnum/Magnum.h"
@ -1230,7 +1231,7 @@ class Sdl2Application::TextInputEvent {
constexpr Containers::ArrayView<const char> text() const { return _text; }
private:
constexpr TextInputEvent(Containers::ArrayView<const char> text): _text{text} {}
constexpr TextInputEvent(Containers::ArrayView<const char> text): _text{text}, _accepted{false} {}
Containers::ArrayView<const char> _text;
bool _accepted;
@ -1281,7 +1282,7 @@ class Sdl2Application::TextEditingEvent {
constexpr Int length() const { return _length; }
private:
constexpr TextEditingEvent(Containers::ArrayView<const char> text, Int start, Int length): _text{text}, _start{start}, _length{length} {}
constexpr TextEditingEvent(Containers::ArrayView<const char> text, Int start, Int length): _text{text}, _start{start}, _length{length}, _accepted{false} {}
Containers::ArrayView<const char> _text;
Int _start, _length;

Loading…
Cancel
Save