parent
6a7335a51f
commit
13cc8ba33d
26
src/bin/e.h
26
src/bin/e.h
|
@ -140,6 +140,32 @@ typedef struct _E_Rect E_Rect;
|
|||
while (0)
|
||||
|
||||
#define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x))
|
||||
#define E_RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \
|
||||
{ \
|
||||
if (E_INTERSECTS(_x, _y, _w, _h, _cx, _cy, _cw, _ch)) \
|
||||
{ \
|
||||
if (_x < (_cx)) \
|
||||
{ \
|
||||
_w += _x - (_cx); \
|
||||
_x = (_cx); \
|
||||
if (_w < 0) _w = 0; \
|
||||
} \
|
||||
if ((_x + _w) > ((_cx) + (_cw))) \
|
||||
_w = (_cx) + (_cw) - _x; \
|
||||
if (_y < (_cy)) \
|
||||
{ \
|
||||
_h += _y - (_cy); \
|
||||
_y = (_cy); \
|
||||
if (_h < 0) _h = 0; \
|
||||
} \
|
||||
if ((_y + _h) > ((_cy) + (_ch))) \
|
||||
_h = (_cy) + (_ch) - _y; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
_w = 0; _h = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define E_REMOTE_OPTIONS 1
|
||||
#define E_REMOTE_OUT 2
|
||||
|
|
Loading…
Reference in New Issue