MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / PointInRect

Function PointInRect

LibLemon/src/gfx/graphics.cpp:47–49  ·  view source on GitHub ↗

Check if a point lies inside a rectangle

Source from the content-addressed store, hash-verified

45
46 // Check if a point lies inside a rectangle
47 bool PointInRect(rect_t rect, vector2i_t point){
48 return (point.x >= rect.pos.x && point.x < rect.pos.x + rect.size.x && point.y >= rect.pos.y && point.y < rect.pos.y + rect.size.y);
49 }
50
51 rgba_colour_t AverageColour(rgba_colour_t c1, rgba_colour_t c2){
52 int r = static_cast<int>(c1.r) + c2.r;

Callers 12

PointInWindowFunction · 0.85
PointInWindowProperFunction · 0.85
MouseDownMethod · 0.85
MouseUpMethod · 0.85
DrawMethod · 0.85
PaintMethod · 0.85
OnMouseDownMethod · 0.85
OnRightMouseDownMethod · 0.85
OnDoubleClickMethod · 0.85
PaintMethod · 0.85
OnMouseUpMethod · 0.85
PaintMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected