-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate drawing/testing; show error label when mouse is near arrow
- Loading branch information
1 parent
d337b2b
commit 92c8cc8
Showing
2 changed files
with
115 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
RedArrow.glyphsReporter/Contents/Resources/geometry_functions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from math import sqrt | ||
|
||
def distance_between_points(p0, p1, do_round=False): | ||
d = sqrt((p1[1] - p0[1])**2 + (p1[0] - p0[0])**2) | ||
if do_round: | ||
return int(round(d)) | ||
else: | ||
return d |