ManaPlus
Public Member Functions | Data Fields
ClipRect Class Reference

#include <cliprect.h>

Inheritance diagram for ClipRect:
Rect

Public Member Functions

 ClipRect ()
 
 ClipRect (const int x0, const int y0, const int width0, const int height0, const int xOffset0, const int yOffset0)
 
- Public Member Functions inherited from Rect
 Rect ()
 
 Rect (const int x_, const int y_, const int width_, const int height_)
 
 Rect (const Rect &r)
 
Rectoperator= (const Rect &r)
 
virtual ~Rect ()
 
void setAll (const int x0, const int y0, const int width0, const int height0)
 
bool isIntersecting (const Rect &rectangle) const
 
bool isPointInRect (const int x_, const int y_) const
 

Data Fields

int xOffset
 
int yOffset
 
- Data Fields inherited from Rect
int x
 
int y
 
int width
 
int height
 

Detailed Description

A rectangle used when dealing with clipping. A clip rectangle is a regular rectangle extended with variables for x offsets and y offsets. The offsets are used for calculations from relative screen coordinates to actual screen coordinates.

Definition at line 78 of file cliprect.h.

Constructor & Destructor Documentation

◆ ClipRect() [1/2]

ClipRect::ClipRect ( )
inline

Constructor.

Definition at line 84 of file cliprect.h.

84  :
85  Rect(0, 0, 0, 0),
86  xOffset(0),
87  yOffset(0)
88  {
89  }
int yOffset
Definition: cliprect.h:127
int xOffset
Definition: cliprect.h:122
Rect()
Definition: rect.h:80

◆ ClipRect() [2/2]

ClipRect::ClipRect ( const int  x0,
const int  y0,
const int  width0,
const int  height0,
const int  xOffset0,
const int  yOffset0 
)
inline

Constructor.

Parameters
x0The rectangle x coordinate.
y0The rectangle y coordinate.
width0The rectangle width.
height0The rectangle height.
xOffset0The offset of the x coordinate. Used to for calculating the actual screen coordinate from the relative screen coordinate.
yOffset0The offset of the y coordinate. Used to for calculating the actual screen coordinate from the relative screen coordinate.

Definition at line 105 of file cliprect.h.

110  :
111  Rect(x0, y0, width0, height0),
112  xOffset(xOffset0),
113  yOffset(yOffset0)
114  {
115  }

Field Documentation

◆ xOffset

int ClipRect::xOffset

Holds the x offset of the x coordinate.

Definition at line 122 of file cliprect.h.

Referenced by Button::draw(), Graphics::pushClipArea(), and ScrollArea::updateCalcFlag().

◆ yOffset

int ClipRect::yOffset

Holds the y offset of the y coordinate.

Definition at line 127 of file cliprect.h.

Referenced by BrowserBox::draw(), Button::draw(), StaticBrowserBox::draw(), Graphics::pushClipArea(), and ScrollArea::updateCalcFlag().


The documentation for this class was generated from the following file: