Skip to content

Commit 0bc4465

Browse files
committed
Merge remote-tracking branch 'masatoko/fix-tedit'
2 parents ade3caf + b359da4 commit 0bc4465

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SDL/Raw/Types.hsc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,8 @@ instance Storable Event where
475475
text <- peekArray (#const SDL_TEXTEDITINGEVENT_TEXT_SIZE) $ (#ptr SDL_Event, edit.text) ptr
476476
start <- (#peek SDL_Event, edit.start) ptr
477477
len <- (#peek SDL_Event, edit.length) ptr
478-
return $! TextEditingEvent typ timestamp wid text start len
478+
let upToNull = takeWhile (/= 0) text
479+
return $! TextEditingEvent typ timestamp wid upToNull start len
479480
(#const SDL_TEXTINPUT) -> do
480481
wid <- (#peek SDL_Event, text.windowID) ptr
481482
text <- peekArray (#const SDL_TEXTINPUTEVENT_TEXT_SIZE) $ (#ptr SDL_Event, text.text) ptr

0 commit comments

Comments
 (0)