Skip to content

Some errors with ImVec2 + math while coding a custom checkbox. #6137

Closed
@Smellon69

Description

@Smellon69

Version/Branch of Dear ImGui:

Version: DX9
Branch: It's just the latest version with all the essential files.

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_dx9.cpp + imgui_impl_win32.cpp
Compiler: Visual Studio 2022 Community
Operating System: Revision OS Windows 11 Pro

My Issue/Question:

So I am adding a custom checkbox and here is the line of code causing me all the trouble:
const ImRect bb(pos, pos + pos);
The error is:
No operator "+" matches these operands: operand types are: ImVec2 + ImVec2

Screenshots/Video

image

Standalone, minimal, complete and verifiable example: (see #2261)

// Here's some code anyone can copy and paste to reproduce your issue
const ImRect bb(pos, pos + pos);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions