7#ifndef MYGUI_I_CROPPED_RECTANGLE_H_
8#define MYGUI_I_CROPPED_RECTANGLE_H_
24 return mCroppedParent;
30 mCoord.left = _value.
left;
31 mCoord.top = _value.
top;
36 mCoord.width = _value.
width;
37 mCoord.height = _value.
height;
48 return mCoord.point();
64 return mAbsolutePosition;
70 mAbsolutePosition.left,
71 mAbsolutePosition.top,
72 mAbsolutePosition.left + mCoord.width,
73 mAbsolutePosition.top + mCoord.height};
78 return {mAbsolutePosition.left, mAbsolutePosition.top, mCoord.width, mCoord.height};
84 return mAbsolutePosition.left;
89 return mAbsolutePosition.top;
100 return mCoord.right();
110 return mCoord.bottom();
120 return mCoord.height;
134 return mCoord.left + mMargin.left;
138 return mCoord.right() - mMargin.right;
142 return mCoord.top + mMargin.top;
146 return mCoord.bottom() - mMargin.bottom;
150 return mCoord.width - mMargin.left - mMargin.right;
154 return mCoord.height - mMargin.top - mMargin.bottom;
159 mCroppedParent = _parent;
172 return mMargin.right;
180 return mMargin.bottom;
188 if (getLeft() < mCroppedParent->mMargin.left)
190 mMargin.left = mCroppedParent->mMargin.left - getLeft();
199 if (getRight() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right)
201 mMargin.right = getRight() - (mCroppedParent->getWidth() - mCroppedParent->mMargin.right);
210 if (getTop() < mCroppedParent->mMargin.top)
212 mMargin.top = mCroppedParent->mMargin.top - getTop();
221 if (getBottom() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom)
223 mMargin.bottom = getBottom() - (mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom);
237 (getRight() < mCroppedParent->mMargin.left) ||
238 (getLeft() > mCroppedParent->getWidth() - mCroppedParent->mMargin.right) ||
239 (getBottom() < mCroppedParent->mMargin.top) ||
240 (getTop() > mCroppedParent->getHeight() - mCroppedParent->mMargin.bottom));
248 bool mIsMargin{
false};
virtual ~ICroppedRectangle()=default
int _getMarginBottom() const
virtual void setPosition(const IntPoint &_value)
virtual void setCoord(const IntCoord &_value)
int getAbsoluteLeft() const
const IntPoint & getAbsolutePosition() const
IntPoint getPosition() const
bool _checkOutside() const
int _getMarginRight() const
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