@@ -209,7 +209,7 @@ void setClipboardText(void* /*userData*/, const char* text)
209
209
{
210
210
static std::string s_clipboardText;
211
211
212
- auto tmp = sf::Clipboard::getString ().toUtf8 ();
212
+ const auto tmp = sf::Clipboard::getString ().toUtf8 ();
213
213
s_clipboardText.assign (tmp.begin (), tmp.end ());
214
214
return s_clipboardText.c_str ();
215
215
}
@@ -349,10 +349,10 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF
349
349
350
350
void SetCurrentWindow (const sf::Window& window)
351
351
{
352
- auto found = std::find_if (s_windowContexts.begin (),
353
- s_windowContexts.end (),
354
- [&](std::unique_ptr<WindowContext>& ctx)
355
- { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
352
+ const auto found = std::find_if (s_windowContexts.begin (),
353
+ s_windowContexts.end (),
354
+ [&](std::unique_ptr<WindowContext>& ctx)
355
+ { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
356
356
assert (found != s_windowContexts.end () &&
357
357
" Failed to find the window. Forgot to call ImGui::SFML::Init for the window?" );
358
358
s_currWindowCtx = found->get ();
@@ -589,18 +589,18 @@ void Shutdown(const sf::Window& window)
589
589
const bool needReplacement = (s_currWindowCtx->window ->getNativeHandle () == window.getNativeHandle ());
590
590
591
591
// remove window's context
592
- auto found = std::find_if (s_windowContexts.begin (),
593
- s_windowContexts.end (),
594
- [&](std::unique_ptr<WindowContext>& ctx)
595
- { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
592
+ const auto found = std::find_if (s_windowContexts.begin (),
593
+ s_windowContexts.end (),
594
+ [&](std::unique_ptr<WindowContext>& ctx)
595
+ { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
596
596
assert (found != s_windowContexts.end () &&
597
597
" Window wasn't inited properly: forgot to call ImGui::SFML::Init(window)?" );
598
598
s_windowContexts.erase (found); // s_currWindowCtx can become invalid here!
599
599
600
600
// set current context to some window for convenience if needed
601
601
if (needReplacement)
602
602
{
603
- auto it = s_windowContexts.begin ();
603
+ const auto it = s_windowContexts.begin ();
604
604
if (it != s_windowContexts.end ())
605
605
{
606
606
// set to some other window
@@ -835,7 +835,7 @@ void Image(const sf::Sprite& sprite, const sf::Color& tintColor, const sf::Color
835
835
836
836
void Image (const sf::Sprite& sprite, const sf::Vector2f& size, const sf::Color& tintColor, const sf::Color& borderColor)
837
837
{
838
- auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
838
+ const auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
839
839
ImGui::Image (textureID, toImVec2 (size), uv0, uv1, toImColor (tintColor), toImColor (borderColor));
840
840
}
841
841
@@ -876,7 +876,7 @@ bool ImageButton(const char* id,
876
876
877
877
bool ImageButton (const char * id, const sf::Sprite& sprite, const sf::Vector2f& size, const sf::Color& bgColor, const sf::Color& tintColor)
878
878
{
879
- auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
879
+ const auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
880
880
return ImGui::ImageButton (id, textureID, toImVec2 (size), uv0, uv1, toImColor (bgColor), toImColor (tintColor));
881
881
}
882
882
0 commit comments