GUI & 2D drawing rectangle
struct rect { ivec2 start, end; };
struct rect { ivec2 pos, size; };
Poll ended at .
@cancel the downside of using two corners is the ambiguity of if the second corner is included. The mathematically“right” answer puts pixel centers at half coordinates. But that’s not intuitive. People want to specify the stop pixel.. so (0,0) - (1,1) is a 2x2 rectangle. But that’s means you need to add 1 to get the width.
Using pixel edge coordinates + size solves all these problems and also appears to work right even if user assumes pixel center coordinates.