Skip to content

Commit

Permalink
Little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettBillingsley committed Nov 22, 2015
1 parent 5a94c9c commit f1f0702
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/imguitest.croc
Expand Up @@ -260,7 +260,7 @@ function doEvents()
break break


case "scroll": case "scroll":
imgui.io.setMouseWheel(b > 0 ? 1 : b < 0 ? -1 : 0) imgui.io.setMouseWheel(b <=> 0)
break break


case "key": case "key":
Expand Down
2 changes: 1 addition & 1 deletion src/croc/addons/glfw.cpp
Expand Up @@ -996,7 +996,7 @@ while(not window.shouldClose())
\returns an event as specified in the docs for \link{pollEvents}.)"), \returns an event as specified in the docs for \link{pollEvents}.)"),


"waitEvents", 0 "waitEvents", 1 // 1 so it can be used as an "opApply"
}; };


word_t _waitEvents(CrocThread* t) word_t _waitEvents(CrocThread* t)
Expand Down
4 changes: 2 additions & 2 deletions src/croc/ext/imgui/imgui.cpp
Expand Up @@ -5651,7 +5651,7 @@ ImVec2 ImBitmapFont::CalcTextSizeA(float size, float max_width, const char* text
const char* s = text_begin; const char* s = text_begin;
while (s < text_end) while (s < text_end)
{ {
unsigned int c; unsigned int c = 0;
const int bytes_count = ImTextCharFromUtf8(&c, s, text_end); const int bytes_count = ImTextCharFromUtf8(&c, s, text_end);
s += bytes_count > 0 ? bytes_count : 1; // Handle decoding failure by skipping to next byte s += bytes_count > 0 ? bytes_count : 1; // Handle decoding failure by skipping to next byte


Expand Down Expand Up @@ -5780,7 +5780,7 @@ void ImBitmapFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& c
float y = pos.y; float y = pos.y;
for (const char* s = text_begin; s < text_end; ) for (const char* s = text_begin; s < text_end; )
{ {
unsigned int c; unsigned int c = 0;
const int bytes_count = ImTextCharFromUtf8(&c, s, text_end); const int bytes_count = ImTextCharFromUtf8(&c, s, text_end);
s += bytes_count > 0 ? bytes_count : 1; // Handle decoding failure by skipping to next byte s += bytes_count > 0 ? bytes_count : 1; // Handle decoding failure by skipping to next byte
if (c >= 0x10000) if (c >= 0x10000)
Expand Down

0 comments on commit f1f0702

Please sign in to comment.