Skip to content

Commit 8f576db

Browse files
authored
BRAYNS-660 Bug in Python image region. (#1281)
1 parent 4716c12 commit 8f576db

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

python/brayns/core/camera.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def translate(self, translation: Vector3) -> Camera:
190190
view=self.view.translate(translation),
191191
projection=copy.deepcopy(self.projection),
192192
near_clipping_distance=self.near_clipping_distance,
193+
image_start=self.image_start,
194+
image_end=self.image_end,
193195
)
194196

195197
def rotate_around_target(self, rotation: Rotation) -> Camera:
@@ -204,6 +206,8 @@ def rotate_around_target(self, rotation: Rotation) -> Camera:
204206
view=self.view.rotate_around_target(rotation),
205207
projection=copy.deepcopy(self.projection),
206208
near_clipping_distance=self.near_clipping_distance,
209+
image_start=self.image_start,
210+
image_end=self.image_end,
207211
)
208212

209213

python/tests/core/test_camera.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def test_translate(self) -> None:
8080
self.assertEqual(test.view, view)
8181
self.assertEqual(test.projection, ref.projection)
8282
self.assertIsNot(test.projection, ref.projection)
83+
self.assertEqual(test.near_clipping_distance, ref.near_clipping_distance)
84+
self.assertEqual(test.image_start, ref.image_start)
85+
self.assertEqual(test.image_end, ref.image_end)
8386

8487
def test_rotate_around_target(self) -> None:
8588
rotation = brayns.euler(1, 2, 3, degrees=True)
@@ -89,3 +92,6 @@ def test_rotate_around_target(self) -> None:
8992
self.assertEqual(test.view, view)
9093
self.assertEqual(test.projection, ref.projection)
9194
self.assertIsNot(test.projection, ref.projection)
95+
self.assertEqual(test.near_clipping_distance, ref.near_clipping_distance)
96+
self.assertEqual(test.image_start, ref.image_start)
97+
self.assertEqual(test.image_end, ref.image_end)

0 commit comments

Comments
 (0)