7#ifndef MYGUI_I_CROPPED_RECTANGLE_H_
8#define MYGUI_I_CROPPED_RECTANGLE_H_
21 mCroppedParent(nullptr)
29 return mCroppedParent;
35 mCoord.left = _value.
left;
36 mCoord.top = _value.
top;
41 mCoord.width = _value.
width;
42 mCoord.height = _value.
height;
53 return mCoord.point();
69 return mAbsolutePosition;
74 return IntRect(mAbsolutePosition.left, mAbsolutePosition.top, mAbsolutePosition.left + mCoord.width, mAbsolutePosition.top + mCoord.height);
79 return IntCoord(mAbsolutePosition.left, mAbsolutePosition.top, mCoord.width, mCoord.height);
85 return mAbsolutePosition.left;
90 return mAbsolutePosition.top;
101 return mCoord.right();
111 return mCoord.bottom();
121 return mCoord.height;
135 return mCoord.left + mMargin.left;
139 return mCoord.right() - mMargin.right;
143 return mCoord.top + mMargin.top;
147 return mCoord.bottom() - mMargin.bottom;
151 return mCoord.width - mMargin.left - mMargin.right;
155 return mCoord.height - mMargin.top - mMargin.bottom;
160 mCroppedParent = _parent;
173 return mMargin.right;
181 return mMargin.bottom;
189 if (getLeft() < mCroppedParent->mMargin.left)
191 mMargin.left = mCroppedParent->mMargin.left - getLeft();
200 if (getRight() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right)
202 mMargin.right = getRight() - (mCroppedParent->getWidth() - mCroppedParent->mMargin.right);
211 if (getTop() < mCroppedParent->mMargin.top)
213 mMargin.top = mCroppedParent->mMargin.top - getTop();
222 if (getBottom() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom)
224 mMargin.bottom = getBottom() - (mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom);
237 return ( (getRight() < mCroppedParent->mMargin.left ) ||
238 (getLeft() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right ) ||
239 (getBottom() < mCroppedParent->mMargin.top ) ||
240 (getTop() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom ) );
int _getMarginBottom() const
virtual void setPosition(const IntPoint &_value)
virtual ~ICroppedRectangle()
virtual void setCoord(const IntCoord &_value)
int getAbsoluteLeft() const
const IntPoint & getAbsolutePosition() const
IntPoint getPosition() const
bool _checkOutside() const
int _getMarginRight() const
ICroppedRectangle * mCroppedParent
int _getMarginLeft() const
const IntRect & _getMargin() const
IntPoint mAbsolutePosition
int _getMarginTop() const
const IntCoord & getCoord() const
ICroppedRectangle * getCroppedParent()
IntRect getAbsoluteRect() const
IntCoord getAbsoluteCoord() const
void _setCroppedParent(ICroppedRectangle *_parent)
virtual void setSize(const IntSize &_value)
int getAbsoluteTop() const
int _getViewRight() const
int _getViewWidth() const
int _getViewBottom() const
int _getViewHeight() const
types::TCoord< int > IntCoord
types::TRect< int > IntRect