apparently this is faster than min()/max() ... ?!

This commit is contained in:
Stefan Harmuth 2022-01-14 11:58:26 +01:00
parent dbd308dbf3
commit 3590c2550c

View File

@ -43,13 +43,13 @@ class Grid:
self.mode3D = False
def __trackBoundaries(self, pos: Coordinate):
self.minX = min(pos.x, self.minX)
self.minY = min(pos.y, self.minY)
self.maxX = max(pos.x, self.maxX)
self.maxY = max(pos.y, self.maxY)
self.minX = pos.x if pos.x < self.minX else self.minX
self.minY = pos.y if pos.y < self.minY else self.minY
self.maxX = pos.x if pos.x > self.maxX else self.maxX
self.maxY = pos.y if pos.y > self.maxY else self.maxY
if self.mode3D:
self.minZ = min(pos.z, self.minZ)
self.maxZ = max(pos.z, self.maxZ)
self.minZ = pos.z if pos.z < self.minZ else self.minZ
self.maxZ = pos.z if pos.z > self.maxZ else self.maxZ
def rangeX(self, pad: int = 0, reverse=False):
if reverse: