Skip to content

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

@achabense

Description

@achabense

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions