close
Skip to content

Line not drawing at the points I specify #3258

Description

Apologies if this has been addressed before but I didn't find anything from a quick Google search.

I have the following code:

auto dl = ImGui::GetForegroundDrawList();

vec2 offset = {10, 10};
dl->AddRectFilled(offset, offset + vec2(100, 100), 0xFFFFFFFF);
dl->AddRectFilled(offset + vec2(0, 100), offset + vec2(100, 200), 0xFF000000);

dl->AddLine(offset + vec2(50, 0), offset + vec2(50, 100), 0xFF0000FF);

The line is being drawn 1 pixel lower than it should be, on the start and end points. Here's what it looks like:
image

I'm probably just doing something stupid here but, I really don't understand why this happens!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions