-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
LilyWangLL
committed
Oct 24, 2024
1 parent
a8daa9e
commit 9d4f74f
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/src/hello_imgui/internal/image_from_asset.cpp b/src/hello_imgui/internal/image_from_asset.cpp | ||
index 7416a69..7151e2f 100644 | ||
--- a/src/hello_imgui/internal/image_from_asset.cpp | ||
+++ b/src/hello_imgui/internal/image_from_asset.cpp | ||
@@ -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; | ||
} | ||
|
||
diff --git a/src/hello_imgui/internal/image_gl_deprecated.cpp b/src/hello_imgui/internal/image_gl_deprecated.cpp | ||
index 5c66c24..98d21d5 100644 | ||
--- a/src/hello_imgui/internal/image_gl_deprecated.cpp | ||
+++ b/src/hello_imgui/internal/image_gl_deprecated.cpp | ||
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters