mirror of
https://github.com/pim-n/pg-rad
synced 2026-04-24 21:18:10 +02:00
improve out of bounds handling of source placement
This commit is contained in:
@ -145,8 +145,13 @@ class LandscapeBuilder:
|
|||||||
along_path=along_path,
|
along_path=along_path,
|
||||||
side=s.side,
|
side=s.side,
|
||||||
dist_from_path=s.dist_from_path)
|
dist_from_path=s.dist_from_path)
|
||||||
if any(
|
|
||||||
p < 0 or p >= s for p, s in zip(pos, self._size)
|
# we dont support -x values, but negative y values are possible as
|
||||||
|
# the path is centered in the y direction.
|
||||||
|
print(pos)
|
||||||
|
if not (
|
||||||
|
(0 < pos[0] < self._size[0]) and
|
||||||
|
(-0.5 * self._size[1] < pos[1] < 0.5 * self._size[1])
|
||||||
):
|
):
|
||||||
raise OutOfBoundsError(
|
raise OutOfBoundsError(
|
||||||
"One or more sources attempted to "
|
"One or more sources attempted to "
|
||||||
|
|||||||
Reference in New Issue
Block a user