Skip to content

Commit

Permalink
ImGui: Fix DPI scale, disable unneeded logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 24, 2024
1 parent 6dfc5ea commit 2a1cda0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions UI/ImDebugger/ImDisasmView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,17 @@ void ImDisasmView::Draw(ImDrawList *drawList) {
ImGuiIO& io = ImGui::GetIO();
ImVec2 mousePos = ImVec2(io.MousePos.x - canvas_p0.x, io.MousePos.y - canvas_p0.y);
if (is_hovered && ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
INFO_LOG(Log::CPU, "Mousedown %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
// INFO_LOG(Log::CPU, "Mousedown %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
onMouseDown(mousePos.x, mousePos.y, 1);
}
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left)) {
INFO_LOG(Log::CPU, "Mouseup %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
// INFO_LOG(Log::CPU, "Mouseup %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
if (is_hovered) {
onMouseUp(mousePos.x, mousePos.y, 1);
}
}
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
INFO_LOG(Log::CPU, "Mousedrag %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
// INFO_LOG(Log::CPU, "Mousedrag %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
if (is_hovered) {
onMouseMove(mousePos.x, mousePos.y, 1);
}
Expand Down
4 changes: 2 additions & 2 deletions ext/imgui/imgui_impl_thin3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ void ImGui_ImplThin3d_DestroyDeviceObjects() {
bool ImGui_ImplThin3d_Init(Draw::DrawContext *draw, const uint8_t *ttf_font, size_t size) {
ImGuiIO& io = ImGui::GetIO();
if (ttf_font) {
io.Fonts->AddFontFromMemoryTTF((void *)ttf_font, size, 18.0f * g_display.dpi_scale_x, nullptr, io.Fonts->GetGlyphRangesDefault());
io.Fonts->AddFontFromMemoryTTF((void *)ttf_font, (int)size, 21.0f / g_display.dpi_scale_x, nullptr, io.Fonts->GetGlyphRangesDefault());
} else {
// necessary?
io.Fonts->AddFontDefault();
}
ImGui::GetStyle().ScaleAllSizes(g_display.dpi_scale_x);
ImGui::GetStyle().ScaleAllSizes(1.0f / g_display.dpi_scale_x);

IMGUI_CHECKVERSION();
IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
Expand Down

0 comments on commit 2a1cda0

Please sign in to comment.