mirror of
https://github.com/pim-n/pg-rad
synced 2026-06-17 15:59:35 +02:00
add bounds_check optional flag (default false)
This commit is contained in:
@ -107,7 +107,8 @@ class LandscapeBuilder:
|
||||
|
||||
def set_point_sources(
|
||||
self,
|
||||
*sources: AbsolutePointSourceSpec | RelativePointSourceSpec
|
||||
*sources: AbsolutePointSourceSpec | RelativePointSourceSpec,
|
||||
bounds_check: bool = False
|
||||
):
|
||||
"""Add one or more point sources to the world.
|
||||
|
||||
@ -148,7 +149,7 @@ class LandscapeBuilder:
|
||||
|
||||
# we dont support -x values, but negative y values are possible as
|
||||
# the path is centered in the y direction.
|
||||
if not (
|
||||
if bounds_check and not (
|
||||
(0 <= pos[0] <= self._size[0]) and
|
||||
(-0.5 * self._size[1] <= pos[1] <= 0.5 * self._size[1])
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user