Merge pull request #4127 from Dhilan007/ANCHOR_XXX

[ci skip]Point: Adds ANCHOR_XXX constants like ANCHOR_MIDDLE, ANCHOR_TOP_RIGHT, e...
This commit is contained in:
minggo 2013-11-07 18:45:50 -08:00
commit 167242e540
3 changed files with 29 additions and 1 deletions

View File

@ -284,6 +284,15 @@ Point Point::getIntersectPoint(const Point& A, const Point& B, const Point& C, c
}
const Point Point::ZERO = Point(0, 0);
const Point Point::ANCHOR_MIDDLE = Point(0.5, 0.5);
const Point Point::ANCHOR_BOTTOM_LEFT = Point(0, 0);
const Point Point::ANCHOR_TOP_LEFT = Point(0, 1);
const Point Point::ANCHOR_BOTTOM_RIGHT = Point(1, 0);
const Point Point::ANCHOR_TOP_RIGHT = Point(1, 1);
const Point Point::ANCHOR_MIDDLE_RIGHT = Point(1, .5);
const Point Point::ANCHOR_MIDDLE_LEFT = Point(0, 0.5);
const Point Point::ANCHOR_MIDDLE_TOP = Point(0.5, 1);
const Point Point::ANCHOR_MIDDLE_BOTTOM = Point(0.5, 0);
// implementation of Size

View File

@ -423,7 +423,26 @@ public:
*/
static Point getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D);
/** equals to Point(0,0) */
static const Point ZERO;
/** equals to Point(0.5, 0.5) */
static const Point ANCHOR_MIDDLE;
/** equals to Point(0, 0) */
static const Point ANCHOR_BOTTOM_LEFT;
/** equals to Point(0, 1) */
static const Point ANCHOR_TOP_LEFT;
/** equals to Point(1, 0) */
static const Point ANCHOR_BOTTOM_RIGHT;
/** equals to Point(1, 1) */
static const Point ANCHOR_TOP_RIGHT;
/** equals to Point(1, 0.5) */
static const Point ANCHOR_MIDDLE_RIGHT;
/** equals to Point(0, 0.5) */
static const Point ANCHOR_MIDDLE_LEFT;
/** equals to Point(0.5, 1) */
static const Point ANCHOR_MIDDLE_TOP;
/** equals to Point(0.5, 0) */
static const Point ANCHOR_MIDDLE_BOTTOM;
private:
// returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part

View File

@ -1 +1 @@
71aa9486e8535b9bd65cae247bb86de59c83f522
dd564ef17f9cc0281964247923ec24957cad7bd0