Skip to content

Commit 8b83e0a

Browse files
committed
Fix OSX warnings + Examples/Apple+GL2 calls super reshape. (#4759, #1873)
1 parent 1b6b860 commit 8b83e0a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/example_apple_opengl2/main.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ -(void)updateAndDrawDemoView
146146
animationTimer = [NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(animationTimerFired:) userInfo:nil repeats:YES];
147147
}
148148

149-
-(void)reshape { [[self openGLContext] update]; [self updateAndDrawDemoView]; }
149+
-(void)reshape { [super reshape]; [[self openGLContext] update]; [self updateAndDrawDemoView]; }
150150
-(void)drawRect:(NSRect)bounds { [self updateAndDrawDemoView]; }
151151
-(void)animationTimerFired:(NSTimer*)timer { [self setNeedsDisplay:YES]; }
152152
-(void)dealloc { animationTimer = nil; }

imgui_widgets.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3695,11 +3695,11 @@ static int is_word_boundary_from_right(ImGuiInputTextState* obj, int idx)
36953695
static int is_word_boundary_from_left(ImGuiInputTextState* obj, int idx) { if (obj->Flags & ImGuiInputTextFlags_Password) return 0; return idx > 0 ? (!is_separator(obj->TextW[idx - 1]) && is_separator(obj->TextW[idx])) : 1; }
36963696
static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; }
36973697
static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; }
3698-
static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; }
36993698
#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h
37003699
#ifdef __APPLE__ // FIXME: Move setting to IO structure
37013700
#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_MAC
37023701
#else
3702+
static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; }
37033703
#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_WIN
37043704
#endif
37053705

0 commit comments

Comments
 (0)