Skip to content

Commit 29ac674

Browse files
committed
RenderedTarget: Check bounding rect in contains()
1 parent ef277d4 commit 29ac674

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/renderedtarget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ bool RenderedTarget::contains(const QPointF &point) const
442442
if (m_stageModel)
443443
return true; // the stage contains any point within the scene
444444

445+
if (!boundingRect().contains(point))
446+
return false;
447+
445448
for (const auto &hullPoint : m_hullPoints) {
446449
if (point.toPoint() == hullPoint.toPoint())
447450
return true;

test/renderedtarget/renderedtarget_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ TEST_F(RenderedTargetTest, HullPoints)
505505
painter.endFrame();
506506

507507
// Test hull points
508+
target.setWidth(3);
509+
target.setHeight(3);
508510
target.updateHullPoints(&fbo);
509511
ASSERT_EQ(target.hullPoints(), std::vector<QPointF>({ { 1, 1 }, { 2, 1 }, { 3, 1 }, { 1, 2 }, { 3, 2 }, { 1, 3 }, { 2, 3 }, { 3, 3 } }));
510512

0 commit comments

Comments
 (0)