diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 0cff4129..44c6175a 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -85,6 +85,8 @@ Other Changes: - Reworked io.ConfigInputTextEnterKeepActive mode so that pressing Enter will deactivate/reactivate the item in order for e.g. IsItemDeactivatedAfterEdit() signals to be emitted the same way regardless of that setting. (#9001, #9115) + - Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset + would be incorrect during the deactivation frame. (#9298) - Style: - Border sizes are now scaled (and rounded) by ScaleAllSizes(). - When using large values with ScallAllSizes(), the following items thickness @@ -134,6 +136,7 @@ Other Changes: to allocate one. (#8677) [@micb25] - WebGPU: fixed undefined behaviors in example code for requesting adapter and device. (#9246, #9256) [@r-lyeh] + - SDL2+WebGPU: fixed hi-dpi handling. (#9300) [@ypujante] - GLFW/SDL2/SDL3+WebGPU: removed suport for Emscripten <4.0.10. (#9281) [@ypujante] diff --git a/examples/example_sdl2_wgpu/main.cpp b/examples/example_sdl2_wgpu/main.cpp index b4c1be96..8d7c5a10 100644 --- a/examples/example_sdl2_wgpu/main.cpp +++ b/examples/example_sdl2_wgpu/main.cpp @@ -53,7 +53,7 @@ int main(int, char**) // Create window with graphics context float main_scale = ImGui_ImplSDL2_GetContentScaleForDisplay(0); - SDL_WindowFlags window_flags = SDL_WINDOW_RESIZABLE; + SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); SDL_Window* window = SDL_CreateWindow("Dear ImGui SDL2+WebGPU example", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, wgpu_surface_width, wgpu_surface_height, window_flags); if (window == nullptr) { @@ -143,7 +143,7 @@ int main(int, char**) // React to changes in screen size int width, height; - SDL_GetWindowSize(window, &width, &height); + SDL_GetWindowSizeInPixels(window, &width, &height); if (width != wgpu_surface_width || height != wgpu_surface_height) ResizeSurface(width, height); diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 7395fad6..1bc875f6 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -5568,7 +5568,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } // Find render position for right alignment (single-line only) - if (g.ActiveId != id && flags & ImGuiInputTextFlags_ElideLeft) + if (g.ActiveId != id && (flags & ImGuiInputTextFlags_ElideLeft) && !render_cursor && !render_selection) draw_pos.x = ImMin(draw_pos.x, frame_bb.Max.x - CalcTextSize(buf_display, NULL).x - style.FramePadding.x); //draw_scroll.x = state->Scroll.x; // Preserve scroll when inactive?