Skip to content

Commit 4f1d380

Browse files
tanksdudeocornut
authored andcommitted
Fixed tabs and spaces (#8377)
1 parent 0625b37 commit 4f1d380

File tree

21 files changed

+103
-103
lines changed

21 files changed

+103
-103
lines changed

.github/ISSUE_TEMPLATE/issue_template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
For anything else: **we are happy to use 'GitHub Issues' for many types of open-ended questions**. We are encouraging 'Issues' becoming a large, centralized, tagged, cross-referenced database of Dear ImGui contents.
99
1010
Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users.
11-
11+
1212
**If you are using Dear ImGui as part of a job that you are being well-paid for** and your company is not a sponsor. Please be mindful that this is a Free Software and you might be about to ask volunteers to help you doing your job. Please put extra effort describing your issue or question properly. If your company is wealthy, please read [Funding](https://github.com/ocornut/imgui/wiki/Funding) and consider getting in touch.
1313
- type: markdown
1414
attributes:

backends/imgui_impl_glfw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c)
469469

470470
void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor*, int)
471471
{
472-
// Unused in 'master' branch but 'docking' branch will use this, so we declare it ahead of it so if you have to install callbacks you can install this one too.
472+
// Unused in 'master' branch but 'docking' branch will use this, so we declare it ahead of it so if you have to install callbacks you can install this one too.
473473
}
474474

475475
#ifdef EMSCRIPTEN_USE_EMBEDDED_GLFW3

backends/imgui_impl_glut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
static int g_Time = 0; // Current time, in milliseconds
5252

53-
// Glut has 1 function for characters and one for "special keys". We map the characters in the 0..255 range and the keys above.
53+
// Glut has one function for characters and one for "special keys". We map the characters in the 0..255 range and the keys above.
5454
static ImGuiKey ImGui_ImplGLUT_KeyToImGuiKey(int key)
5555
{
5656
switch (key)

backends/imgui_impl_sdlrenderer2.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ void ImGui_ImplSDLRenderer2_Shutdown()
100100

101101
static void ImGui_ImplSDLRenderer2_SetupRenderState(SDL_Renderer* renderer)
102102
{
103-
// Clear out any viewports and cliprect set by the user
103+
// Clear out any viewports and cliprect set by the user
104104
// FIXME: Technically speaking there are lots of other things we could backup/setup/restore during our render process.
105-
SDL_RenderSetViewport(renderer, nullptr);
106-
SDL_RenderSetClipRect(renderer, nullptr);
105+
SDL_RenderSetViewport(renderer, nullptr);
106+
SDL_RenderSetClipRect(renderer, nullptr);
107107
}
108108

109109
void ImGui_ImplSDLRenderer2_NewFrame()
@@ -117,21 +117,21 @@ void ImGui_ImplSDLRenderer2_NewFrame()
117117

118118
void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data, SDL_Renderer* renderer)
119119
{
120-
// If there's a scale factor set by the user, use that instead
120+
// If there's a scale factor set by the user, use that instead
121121
// If the user has specified a scale factor to SDL_Renderer already via SDL_RenderSetScale(), SDL will scale whatever we pass
122122
// to SDL_RenderGeometryRaw() by that scale factor. In that case we don't want to be also scaling it ourselves here.
123123
float rsx = 1.0f;
124-
float rsy = 1.0f;
125-
SDL_RenderGetScale(renderer, &rsx, &rsy);
124+
float rsy = 1.0f;
125+
SDL_RenderGetScale(renderer, &rsx, &rsy);
126126
ImVec2 render_scale;
127-
render_scale.x = (rsx == 1.0f) ? draw_data->FramebufferScale.x : 1.0f;
128-
render_scale.y = (rsy == 1.0f) ? draw_data->FramebufferScale.y : 1.0f;
127+
render_scale.x = (rsx == 1.0f) ? draw_data->FramebufferScale.x : 1.0f;
128+
render_scale.y = (rsy == 1.0f) ? draw_data->FramebufferScale.y : 1.0f;
129129

130-
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
131-
int fb_width = (int)(draw_data->DisplaySize.x * render_scale.x);
132-
int fb_height = (int)(draw_data->DisplaySize.y * render_scale.y);
133-
if (fb_width == 0 || fb_height == 0)
134-
return;
130+
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
131+
int fb_width = (int)(draw_data->DisplaySize.x * render_scale.x);
132+
int fb_height = (int)(draw_data->DisplaySize.y * render_scale.y);
133+
if (fb_width == 0 || fb_height == 0)
134+
return;
135135

136136
// Backup SDL_Renderer state that will be modified to restore it afterwards
137137
struct BackupSDLRendererState
@@ -154,9 +154,9 @@ void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
154154
render_state.Renderer = renderer;
155155
platform_io.Renderer_RenderState = &render_state;
156156

157-
// Will project scissor/clipping rectangles into framebuffer space
158-
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
159-
ImVec2 clip_scale = render_scale;
157+
// Will project scissor/clipping rectangles into framebuffer space
158+
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
159+
ImVec2 clip_scale = render_scale;
160160

161161
// Render command lists
162162
for (int n = 0; n < draw_data->CmdListsCount; n++)
@@ -201,7 +201,7 @@ void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
201201
#endif
202202

203203
// Bind texture, Draw
204-
SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID();
204+
SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID();
205205
SDL_RenderGeometryRaw(renderer, tex,
206206
xy, (int)sizeof(ImDrawVert),
207207
color, (int)sizeof(ImDrawVert),

backends/imgui_impl_sdlrenderer3.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ void ImGui_ImplSDLRenderer3_Shutdown()
9999

100100
static void ImGui_ImplSDLRenderer3_SetupRenderState(SDL_Renderer* renderer)
101101
{
102-
// Clear out any viewports and cliprect set by the user
102+
// Clear out any viewports and cliprect set by the user
103103
// FIXME: Technically speaking there are lots of other things we could backup/setup/restore during our render process.
104-
SDL_SetRenderViewport(renderer, nullptr);
105-
SDL_SetRenderClipRect(renderer, nullptr);
104+
SDL_SetRenderViewport(renderer, nullptr);
105+
SDL_SetRenderClipRect(renderer, nullptr);
106106
}
107107

108108
void ImGui_ImplSDLRenderer3_NewFrame()
@@ -136,21 +136,21 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
136136
{
137137
ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData();
138138

139-
// If there's a scale factor set by the user, use that instead
139+
// If there's a scale factor set by the user, use that instead
140140
// If the user has specified a scale factor to SDL_Renderer already via SDL_RenderSetScale(), SDL will scale whatever we pass
141141
// to SDL_RenderGeometryRaw() by that scale factor. In that case we don't want to be also scaling it ourselves here.
142142
float rsx = 1.0f;
143-
float rsy = 1.0f;
144-
SDL_GetRenderScale(renderer, &rsx, &rsy);
143+
float rsy = 1.0f;
144+
SDL_GetRenderScale(renderer, &rsx, &rsy);
145145
ImVec2 render_scale;
146-
render_scale.x = (rsx == 1.0f) ? draw_data->FramebufferScale.x : 1.0f;
147-
render_scale.y = (rsy == 1.0f) ? draw_data->FramebufferScale.y : 1.0f;
146+
render_scale.x = (rsx == 1.0f) ? draw_data->FramebufferScale.x : 1.0f;
147+
render_scale.y = (rsy == 1.0f) ? draw_data->FramebufferScale.y : 1.0f;
148148

149-
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
150-
int fb_width = (int)(draw_data->DisplaySize.x * render_scale.x);
151-
int fb_height = (int)(draw_data->DisplaySize.y * render_scale.y);
152-
if (fb_width == 0 || fb_height == 0)
153-
return;
149+
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
150+
int fb_width = (int)(draw_data->DisplaySize.x * render_scale.x);
151+
int fb_height = (int)(draw_data->DisplaySize.y * render_scale.y);
152+
if (fb_width == 0 || fb_height == 0)
153+
return;
154154

155155
// Backup SDL_Renderer state that will be modified to restore it afterwards
156156
struct BackupSDLRendererState
@@ -175,9 +175,9 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
175175
render_state.Renderer = renderer;
176176
platform_io.Renderer_RenderState = &render_state;
177177

178-
// Will project scissor/clipping rectangles into framebuffer space
179-
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
180-
ImVec2 clip_scale = render_scale;
178+
// Will project scissor/clipping rectangles into framebuffer space
179+
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
180+
ImVec2 clip_scale = render_scale;
181181

182182
// Render command lists
183183
for (int n = 0; n < draw_data->CmdListsCount; n++)
@@ -218,7 +218,7 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
218218
const SDL_Color* color = (const SDL_Color*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + offsetof(ImDrawVert, col)); // SDL 2.0.19+
219219

220220
// Bind texture, Draw
221-
SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID();
221+
SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID();
222222
SDL_RenderGeometryRaw8BitColor(renderer, bd->ColorBuffer, tex,
223223
xy, (int)sizeof(ImDrawVert),
224224
color, (int)sizeof(ImDrawVert),

backends/imgui_impl_wgpu.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,13 @@ static WGPUProgrammableStageDescriptor ImGui_ImplWGPU_CreateShaderModule(const c
268268
ImGui_ImplWGPU_Data* bd = ImGui_ImplWGPU_GetBackendData();
269269

270270
#ifdef IMGUI_IMPL_WEBGPU_BACKEND_DAWN
271-
WGPUShaderSourceWGSL wgsl_desc = {};
271+
WGPUShaderSourceWGSL wgsl_desc = {};
272272
wgsl_desc.chain.sType = WGPUSType_ShaderSourceWGSL;
273-
wgsl_desc.code = { wgsl_source, WGPU_STRLEN };
273+
wgsl_desc.code = { wgsl_source, WGPU_STRLEN };
274274
#else
275-
WGPUShaderModuleWGSLDescriptor wgsl_desc = {};
275+
WGPUShaderModuleWGSLDescriptor wgsl_desc = {};
276276
wgsl_desc.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor;
277-
wgsl_desc.code = wgsl_source;
277+
wgsl_desc.code = wgsl_source;
278278
#endif
279279

280280
WGPUShaderModuleDescriptor desc = {};

backends/imgui_impl_win32.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -790,20 +790,20 @@ static BOOL _IsWindowsVersionOrGreater(WORD major, WORD minor, WORD)
790790
{
791791
typedef LONG(WINAPI* PFN_RtlVerifyVersionInfo)(OSVERSIONINFOEXW*, ULONG, ULONGLONG);
792792
static PFN_RtlVerifyVersionInfo RtlVerifyVersionInfoFn = nullptr;
793-
if (RtlVerifyVersionInfoFn == nullptr)
794-
if (HMODULE ntdllModule = ::GetModuleHandleA("ntdll.dll"))
795-
RtlVerifyVersionInfoFn = (PFN_RtlVerifyVersionInfo)GetProcAddress(ntdllModule, "RtlVerifyVersionInfo");
793+
if (RtlVerifyVersionInfoFn == nullptr)
794+
if (HMODULE ntdllModule = ::GetModuleHandleA("ntdll.dll"))
795+
RtlVerifyVersionInfoFn = (PFN_RtlVerifyVersionInfo)GetProcAddress(ntdllModule, "RtlVerifyVersionInfo");
796796
if (RtlVerifyVersionInfoFn == nullptr)
797797
return FALSE;
798798

799799
RTL_OSVERSIONINFOEXW versionInfo = { };
800800
ULONGLONG conditionMask = 0;
801801
versionInfo.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOEXW);
802802
versionInfo.dwMajorVersion = major;
803-
versionInfo.dwMinorVersion = minor;
804-
VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
805-
VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
806-
return (RtlVerifyVersionInfoFn(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask) == 0) ? TRUE : FALSE;
803+
versionInfo.dwMinorVersion = minor;
804+
VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
805+
VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
806+
return (RtlVerifyVersionInfoFn(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask) == 0) ? TRUE : FALSE;
807807
}
808808

809809
#define _IsWindowsVistaOrGreater() _IsWindowsVersionOrGreater(HIBYTE(0x0600), LOBYTE(0x0600), 0) // _WIN32_WINNT_VISTA
@@ -861,16 +861,16 @@ float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
861861
UINT xdpi = 96, ydpi = 96;
862862
if (_IsWindows8Point1OrGreater())
863863
{
864-
static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process
865-
static PFN_GetDpiForMonitor GetDpiForMonitorFn = nullptr;
866-
if (GetDpiForMonitorFn == nullptr && shcore_dll != nullptr)
864+
static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process
865+
static PFN_GetDpiForMonitor GetDpiForMonitorFn = nullptr;
866+
if (GetDpiForMonitorFn == nullptr && shcore_dll != nullptr)
867867
GetDpiForMonitorFn = (PFN_GetDpiForMonitor)::GetProcAddress(shcore_dll, "GetDpiForMonitor");
868-
if (GetDpiForMonitorFn != nullptr)
869-
{
870-
GetDpiForMonitorFn((HMONITOR)monitor, MDT_EFFECTIVE_DPI, &xdpi, &ydpi);
868+
if (GetDpiForMonitorFn != nullptr)
869+
{
870+
GetDpiForMonitorFn((HMONITOR)monitor, MDT_EFFECTIVE_DPI, &xdpi, &ydpi);
871871
IM_ASSERT(xdpi == ydpi); // Please contact me if you hit this assert!
872-
return xdpi / 96.0f;
873-
}
872+
return xdpi / 96.0f;
873+
}
874874
}
875875
#ifndef NOGDI
876876
const HDC dc = ::GetDC(nullptr);

docs/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Only if you:
3434

3535
Then please [use the Discussions forums](https://github.com/ocornut/imgui/discussions) instead of opening an issue.
3636

37-
If Dear ImGui is successfully showing in your app and you have used Dear ImGui before, you can open an Issue. Any form of discussions is welcome as a new issue.
37+
If Dear ImGui is successfully showing in your app and you have used Dear ImGui before, you can open an Issue. Any form of discussions is welcome as a new issue.
3838

3939
## How to open an issue
4040

@@ -52,7 +52,7 @@ Steps:
5252
- **Please INCLUDE CODE. Provide a Minimal, Complete, and Verifiable Example ([MCVE](https://stackoverflow.com/help/mcve)) to demonstrate your problem**. An ideal submission includes a small piece of code that anyone can paste into one of the examples applications (examples/../main.cpp) or demo (imgui_demo.cpp) to understand and reproduce it. **Narrowing your problem to its shortest and purest form is the easiest way to understand it, explain it and fix it**. Please test your shortened code to ensure it exhibits the problem. **Often while creating the MCVE you will solve the problem!** Many questions that are missing a standalone verifiable example are missing the actual cause of their issue in the description, which ends up wasting everyone's time.
5353
- **Attach screenshots (or GIF/video) to clarify the context**. They often convey useful information that is omitted by the description. You can drag pictures/files in the message edit box. Avoid using 3rd party image hosting services, prefer the long-term longevity of GitHub attachments (you can drag pictures into your post). On Windows, you can use [ScreenToGif](https://www.screentogif.com/) to easily capture .gif files.
5454
- **If you are discussing an assert or a crash, please provide a debugger callstack**. Never state "it crashes" without additional information. If you don't know how to use a debugger and retrieve a callstack, learning about it will be useful.
55-
- **Please make sure that your project has asserts enabled.** Calls to IM_ASSERT() are scattered in the code to help catch common issues. When an assert is triggered read the comments around it. By default IM_ASSERT() calls the standard assert() function. To verify that your asserts are enabled, add the line `IM_ASSERT(false);` in your main() function. Your application should display an error message and abort. If your application doesn't report an error, your asserts are disabled.
55+
- **Please make sure that your project has asserts enabled.** Calls to IM_ASSERT() are scattered in the code to help catch common issues. When an assert is triggered read the comments around it. By default IM_ASSERT() calls the standard assert() function. To verify that your asserts are enabled, add the line `IM_ASSERT(false);` in your main() function. Your application should display an error message and abort. If your application doesn't report an error, your asserts are disabled.
5656
- Please state if you have made substantial modifications to your copy of Dear ImGui or the back-end.
5757
- If you are not calling Dear ImGui directly from C++, please provide information about your Language and the wrapper/binding you are using.
5858
- Be mindful that messages are being sent to the mailbox of "Watching" users. Try to proofread your messages before sending them. Edits are not seen by those users unless they browse the site.
@@ -65,12 +65,12 @@ If you have been using Dear ImGui for a while or have been using C/C++ for sever
6565

6666
## How to open a Pull Request
6767

68-
- **Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance.** PR should be crafted both in the interest of the end-users and also to ease the maintainer into understanding and accepting it.
68+
- **Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance.** PR should be crafted both in the interest of the end-users and also to ease the maintainer into understanding and accepting it.
6969
- Many PRs are useful to demonstrate a need and a possible solution but aren't adequate for merging (causing other issues, not seeing other aspects of the big picture, etc.). In doubt, don't hesitate to push a PR because that is always the first step toward pointing toward a problem, and finding the mergeable solution! Even if a PR stays unmerged for a long time, its presence can be useful for other users and helps toward finding a general solution.
70-
- **When adding a feature,** please describe the usage context (how you intend to use it, why you need it, etc.). Be mindful of [The XY Problem](http://xyproblem.info/).
70+
- **When adding a feature,** please describe the usage context (how you intend to use it, why you need it, etc.). Be mindful of [The XY Problem](http://xyproblem.info/).
7171
- **When fixing a warning or compilation problem,** please post the compiler log and specify the compiler version and platform you are using.
7272
- **Attach screenshots (or GIF/video) to clarify the context and demonstrate the feature at a glance.** You can drag pictures/files in the message edit box. Prefer the long-term longevity of GitHub attachments over 3rd party hosting (you can drag pictures into your post).
73-
- **Make sure your code follows the coding style already used in the codebase:** 4 spaces indentations (no tabs), `local_variable`, `FunctionName()`, `MemberName`, `// Text Comment`, `//CodeComment();`, C-style casts, etc.. We don't use modern C++ idioms and tend to use only a minimum of C++11 features. The applications under examples/ are generally less consistent because they sometimes try to mimic the coding style often adopted by a certain ecosystem (e.g. DirectX-related code tend to use the style of their sample).
73+
- **Make sure your code follows the coding style already used in the codebase:** 4 spaces indentations (no tabs), `local_variable`, `FunctionName()`, `MemberName`, `// Text Comment`, `//CodeComment();`, C-style casts, etc.. We don't use modern C++ idioms and tend to use only a minimum of C++11 features. The applications under examples/ are generally less consistent because they sometimes try to mimic the coding style often adopted by a certain ecosystem (e.g. DirectX-related code tend to use the style of their sample).
7474
- **Make sure you create a branch dedicated to the pull request**. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR (we can still cherry-pick individual commits).
7575

7676
## Copyright / Contributor License Agreement

docs/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ for (int n = 0; n < 3; n++)
233233
ImGui::End();
234234
</pre>
235235
</td>
236-
</tr>
236+
</tr>
237237
</table>
238238

239239
A primer on labels and the ID Stack...

docs/TODO.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
99
- doc: add a proper documentation system (maybe relying on automation? #435)
1010
- doc: checklist app to verify backends/integration of imgui (test inputs, rendering, callback, etc.).
1111
- doc/tips: tips of the day: website? applet in imgui_club?
12-
12+
1313
- window: preserve/restore relative focus ordering (persistent or not), and e.g. of multiple reappearing windows (#2304) -> also see docking reference to same #.
1414
- window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis). (#690)
1515
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.

0 commit comments

Comments
 (0)