Fix missing hash recompute in vector class.

This commit is contained in:
mrg
2022-05-17 13:30:41 -07:00
parent bed12d2a9e
commit 9b592ab432
2 changed files with 113 additions and 0 deletions
+2
View File
@@ -51,6 +51,7 @@ class vector():
else:
self.x=float(value[0])
self.y=float(value[1])
self._hash = hash((self.x,self.y))
def __getitem__(self, index):
"""
@@ -104,6 +105,7 @@ class vector():
def snap_to_grid(self):
self.x = self.snap_offset_to_grid(self.x)
self.y = self.snap_offset_to_grid(self.y)
self._hash = hash((self.x,self.y))
return self
def snap_offset_to_grid(self, offset):