test for concrete
Python CI / test (push) Successful in 48s

This commit is contained in:
2025-06-07 19:43:59 +02:00
parent 22d3505256
commit 3f9bd0072e
6 changed files with 1490 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ class Box(Renderable, Queriable):
def in_shape(self, point):
return np.all((point >= self.origin) & (point < self._end), axis=-1)
return np.all((point >= self._origin) & (point < self._end), axis=-1)
def render(self) -> Image:
# Create a new image canvas
+4 -1
View File
@@ -43,6 +43,9 @@ class RenderableImage(Box, Queriable):
# Calculate the size if not provided
if size is None:
size = image.calculate_scaled_dimensions(max_width, max_height)
# Ensure we have valid dimensions, fallback to defaults if None
if size[0] is None or size[1] is None:
size = (100, 100) # Default size when image dimensions are unavailable
# Initialize the box
super().__init__(origin or (0, 0), size, callback, sheet, mode, halign, valign)
@@ -131,7 +134,7 @@ class RenderableImage(Box, Queriable):
A resized PIL Image
"""
if not self._pil_image:
return PILImage.new('RGBA', self._size, (200, 200, 200, 100))
return PILImage.new('RGBA', tuple(self._size), (200, 200, 200, 100))
# Get the target dimensions
target_width, target_height = self._size