Created
May 25, 2018 20:57
-
-
Save AbstractBeliefs/af2a4dd2d0a1fa41115ef391ce3d87b7 to your computer and use it in GitHub Desktop.
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
diff --git a/screenlayout/snap.py b/screenlayout/snap.py | |
index 4ae3d25..c596b59 100644 | |
--- a/screenlayout/snap.py | |
+++ b/screenlayout/snap.py | |
@@ -34,6 +34,9 @@ class Snap(object): | |
self.horizontal.add(i[0].top-size.height) | |
self.horizontal.add(i[0].top+i[1].height-size.height) | |
+ self.vertical.add((i[0].left + i[1].width/2)-size.width/2) | |
+ self.horizontal.add((i[0].top + i[1].height/2)-size.height/2) | |
+ | |
def suggest(self, position): | |
vertical = [x for x in self.vertical if abs(x-position[0])<self.tolerance] | |
horizontal = [y for y in self.horizontal if abs(y-position[1])<self.tolerance] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment