@@ -209,7 +209,7 @@ void setClipboardText(ImGuiContext* /*ctx*/, 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
}
@@ -350,10 +350,10 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF
350
350
351
351
void SetCurrentWindow (const sf::Window& window)
352
352
{
353
- auto found = std::find_if (s_windowContexts.begin (),
354
- s_windowContexts.end (),
355
- [&](std::unique_ptr<WindowContext>& ctx)
356
- { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
353
+ const auto found = std::find_if (s_windowContexts.begin (),
354
+ s_windowContexts.end (),
355
+ [&](std::unique_ptr<WindowContext>& ctx)
356
+ { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
357
357
assert (found != s_windowContexts.end () &&
358
358
" Failed to find the window. Forgot to call ImGui::SFML::Init for the window?" );
359
359
s_currWindowCtx = found->get ();
@@ -590,18 +590,18 @@ void Shutdown(const sf::Window& window)
590
590
const bool needReplacement = (s_currWindowCtx->window ->getNativeHandle () == window.getNativeHandle ());
591
591
592
592
// remove window's context
593
- auto found = std::find_if (s_windowContexts.begin (),
594
- s_windowContexts.end (),
595
- [&](std::unique_ptr<WindowContext>& ctx)
596
- { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
593
+ const auto found = std::find_if (s_windowContexts.begin (),
594
+ s_windowContexts.end (),
595
+ [&](std::unique_ptr<WindowContext>& ctx)
596
+ { return ctx->window ->getNativeHandle () == window.getNativeHandle (); });
597
597
assert (found != s_windowContexts.end () &&
598
598
" Window wasn't inited properly: forgot to call ImGui::SFML::Init(window)?" );
599
599
s_windowContexts.erase (found); // s_currWindowCtx can become invalid here!
600
600
601
601
// set current context to some window for convenience if needed
602
602
if (needReplacement)
603
603
{
604
- auto it = s_windowContexts.begin ();
604
+ const auto it = s_windowContexts.begin ();
605
605
if (it != s_windowContexts.end ())
606
606
{
607
607
// set to some other window
@@ -809,7 +809,7 @@ void Image(const sf::Sprite& sprite, const sf::Color& tintColor, const sf::Color
809
809
810
810
void Image (const sf::Sprite& sprite, const sf::Vector2f& size, const sf::Color& tintColor, const sf::Color& borderColor)
811
811
{
812
- auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
812
+ const auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
813
813
ImGui::Image (textureID, toImVec2 (size), uv0, uv1, toImColor (tintColor), toImColor (borderColor));
814
814
}
815
815
@@ -850,7 +850,7 @@ bool ImageButton(const char* id,
850
850
851
851
bool ImageButton (const char * id, const sf::Sprite& sprite, const sf::Vector2f& size, const sf::Color& bgColor, const sf::Color& tintColor)
852
852
{
853
- auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
853
+ const auto [uv0, uv1, textureID] = getSpriteTextureData (sprite);
854
854
return ImGui::ImageButton (id, textureID, toImVec2 (size), uv0, uv1, toImColor (bgColor), toImColor (tintColor));
855
855
}
856
856
0 commit comments