Alternatively,thecontentsofthisfilemaybeusedunderthetermsofthe MozillaPublicLicense(http://mozilla.org/MPL) or the GNU General Public License,aspublishedbytheFreeSoftwareFoundation,eitherversion2 oftheLicenseor(atyouroption)anylaterversion.
*/ #include"inc/Position.h" #include <cmath>
usingnamespace graphite2;
bool Rect::hitTest(Rect &other)
{ if (bl.x > other.tr.x) returnfalse; if (tr.x < other.bl.x) returnfalse; if (bl.y > other.tr.y) returnfalse; if (tr.y < other.bl.y) returnfalse; returntrue;
}
Position Rect::overlap(Position &offset, Rect &other, Position &othero)
{ float ax = (bl.x + offset.x) - (other.tr.x + othero.x); float ay = (bl.y + offset.y) - (other.tr.y + othero.y); float bx = (other.bl.x + othero.x) - (tr.x + offset.x); float by = (other.bl.y + othero.y) - (tr.y + offset.y); return Position((ax > bx ? ax : bx), (ay > by ? ay : by));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.