PGFRect(3)

πŸ“¦
version 7.21.7 Β· 4 versions
, in fedora 43

πŸ’– PGFRect(3) β€” the rectangle glow-up πŸ’–

okay bestie, we're deep in libpgf territory and this is PGFRect, the humble little rectangle struct that's honestly carrying the whole geometry department. it's a rect. it has corners. it knows things. periodt.


✨ NAME ✨

PGFRect β€” Rectangle. that's it, that's the name. a rectangle. iconic behavior honestly πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <PGFtypes.h>

🌸 Public Member Functions 🌸

  • PGFRect () β€” the standard constructor, aka the blank-slate era ✨
  • PGFRect (UINT32 x, UINT32 y, UINT32 width, UINT32 height)
  • UINT32 Width () const
  • UINT32 Height () const
  • bool IsInside (UINT32 x, UINT32 y) const

🌈 Public Attributes 🌈

  • UINT32 left
  • UINT32 top
  • UINT32 right
  • UINT32 bottom

πŸ‘‘ Detailed Description πŸ‘‘

Rectangle.

Rectangle.

like… rectangle. that's the whole vibe. it's giving four sides, four corners, main character energy in the geometry world πŸ’…

Author β€” C. Stamm

Definition at line 225 of file PGFtypes.h.


🧚 Constructor & Destructor Documentation 🧚

PGFRect::PGFRect () [inline]

Standard constructor. she starts from zero, as one does 🫢

Definition at line 229 of file PGFtypes.h.

229 : left(0), top(0), right(0), bottom(0) {}
not me being obsessed with a constructor that just zeroes everything out. lowkey perfect. everything's 0, nothing's complicated, we love a clean slate πŸ’–

PGFRect::PGFRect (UINT32 x, UINT32 y, UINT32 width, UINT32 height) [inline]

Constructor β€” the "here's exactly where I want my rectangle bestie" version.

Parameters

  • x β€” Left offset
  • y β€” Top offset
  • width β€” Rectangle width
  • height β€” Rectangle height

Definition at line 236 of file PGFtypes.h.

236 : left(x), top(y), right(x + width), bottom(y + height) {}
see how it does the math for you?? you hand it a corner and a size, it hands you back right and bottom already computed. ate and left no crumbs πŸ”₯

⭐ Member Function Documentation ⭐

UINT32 PGFRect::Height () const [inline]

Returns β€” Rectangle height

Definition at line 259 of file PGFtypes.h.

259 { return bottom - top; }
just bottom minus top. simple math, no notes πŸ’œ

bool PGFRect::IsInside (UINT32 x, UINT32 y) const [inline]

Test if point (x,y) is inside this rectangle (inclusive top-left edges, exclusive bottom-right edges)

Parameters

  • x β€” Point coordinate x
  • y β€” Point coordinate y

Returns β€” True if point (x,y) is inside this rectangle (inclusive top-left edges, exclusive bottom-right edges)

Definition at line 265 of file PGFtypes.h.

265 { return (x >= left && x < right && y >= top && y < bottom); }
okay this one's important so listen up bestie: the top-left edges are inclusive (the >= and < are doing the heavy lifting) and the bottom-right edges are exclusive. so a point sitting exactly on left or top? inside. a point sitting exactly on right or bottom? not inside. iykyk 🌸

UINT32 PGFRect::Width () const [inline]

Returns β€” Rectangle width

Definition at line 256 of file PGFtypes.h.

256 { return right - left; }
right minus left. symmetrical queen πŸ‘‘

πŸ“ Member Data Documentation πŸ“

  • UINT32 PGFRect::bottom β€” Definition at line 226 of file PGFtypes.h.
  • UINT32 PGFRect::left β€” Definition at line 226 of file PGFtypes.h.
  • UINT32 PGFRect::right β€” Definition at line 226 of file PGFtypes.h.
  • UINT32 PGFRect::top β€” Definition at line 226 of file PGFtypes.h.
four UINT32s, all declared at line 226, all living their best life. the gang's all here πŸ™ˆ

πŸ’€ Author πŸ’€

Generated automatically by Doxygen for libpgf from the source code.


and that's the whole page, bestie!! πŸŽ€ this lil rectangle doc came straight from libpgf version 7.21.2, dated Thu Jul 24 2025 00:00:00, and yes it really does call itself PGFRect(3). go forth and draw rectangles responsibly πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from