mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
New symbol part list control that shows previews and has a built in editor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@529 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+1
-1
@@ -203,7 +203,7 @@ bool pos_on_line(const Vector2D& pos, double range, const Vector2D& p1, const Ve
|
||||
Vector2D p21 = p2 - p1;
|
||||
double p21len = p21.lengthSqr();
|
||||
if (p21len < 0.00001) return false; // line is too short
|
||||
t = p21.dot(pos - p1) / p21len; // 'time' on line p1->p2
|
||||
t = dot(p21, pos - p1) / p21len; // 'time' on line p1->p2
|
||||
if (t < 0 || t > 1) return false; // outside segment
|
||||
pOut = p1 + p21 * t; // point on line
|
||||
Vector2D dist = pOut - pos; // distance to line
|
||||
|
||||
Reference in New Issue
Block a user