Skip to content

Commit

Permalink
ImageGl::DrawButton & ImageButtonFromAsset: use new ImGui::ImageButto…
Browse files Browse the repository at this point in the history
…n signature
  • Loading branch information
pthom committed Sep 10, 2024
1 parent 7d5d373 commit 3ba369a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hello_imgui/internal/image_from_asset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace HelloImGui
auto textureId = cachedImage->TextureID();
auto imageSize = ImVec2((float)cachedImage->Width, (float)cachedImage->Height);
ImVec2 displayedSize = ImageProportionalSize(size, imageSize);
bool clicked = ImGui::ImageButton(textureId, displayedSize, uv0, uv1, frame_padding, bg_col, tint_col);
bool clicked = ImGui::ImageButton(assetPath, textureId, displayedSize, uv0, uv1, bg_col, tint_col);
return clicked;
}

Expand Down
4 changes: 3 additions & 1 deletion src/hello_imgui/internal/image_gl_deprecated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ bool ImageGl::DrawButton(
const ImVec4& tint_col)
{
ImVec2 displayedSize = ImageProportionalSize(size, this->imageSize);
return ImGui::ImageButton(this->imTextureId, displayedSize, uv0, uv1, frame_padding, bg_col, tint_col);
char str_id[64];
snprintf(str_id, 64, "ImageButton_%p", this->imTextureId);
return ImGui::ImageButton(str_id, this->imTextureId, displayedSize, uv0, uv1, bg_col, tint_col);
}

ImageGlPtr ImageGl::FactorImage(const char *assetPath)
Expand Down

0 comments on commit 3ba369a

Please sign in to comment.