Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGui::TextLink doesn't recognize vertical alignment #8451

Closed
achabense opened this issue Mar 2, 2025 · 1 comment
Closed

ImGui::TextLink doesn't recognize vertical alignment #8451

achabense opened this issue Mar 2, 2025 · 1 comment

Comments

@achabense
Copy link

achabense commented Mar 2, 2025

Version/Branch of Dear ImGui:

Version 1.91.8

Back-ends:

Any

Compiler, OS:

Any

Details:

Unlike normal text lines, ImGui::TextLink is not recognizing vertical alignment.

Related code:
ImGui::Text:

const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);

ImGui::TextLink:
ImVec2 pos = window->DC.CursorPos;

Screenshots/Video:

Image

Minimal, Complete and Verifiable Example code:

void issue() {
    if (ImGui::Begin("Issue")) {
        ImGui::AlignTextToFramePadding();
        ImGui::Text("123");
        ImGui::SameLine();
        ImGui::Text("456");

        ImGui::AlignTextToFramePadding();
        ImGui::Text("123");
        ImGui::SameLine();
        ImGui::TextLink("456");

        ImGui::Button("123");
        ImGui::SameLine();
        ImGui::Text("456");

        ImGui::Button("123");
        ImGui::SameLine();
        ImGui::TextLink("456");
    }
    ImGui::End();
}
ocornut added a commit that referenced this issue Mar 2, 2025
@ocornut
Copy link
Owner

ocornut commented Mar 2, 2025

Pushed fix c5ade65, thank you!

@ocornut ocornut closed this as completed Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants