Skip to content

Commit 3b1d316

Browse files
committed
Markers outside of plot filtered out.
1 parent 77f46a3 commit 3b1d316

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/chart/generator/diagram.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,14 @@ void Diagram::normalizeXY()
159159
boundRect.setVSize(yrange.getValue(boundRect.vSize()));
160160

161161
for (auto &marker: markers)
162-
marker.fromRectangle(
163-
boundRect.normalize(marker.toRectangle())
164-
);
162+
{
163+
if (!boundRect.contains(marker.position))
164+
marker.enabled = false;
165+
166+
auto rect = marker.toRectangle();
167+
auto newRect = boundRect.normalize(rect);
168+
marker.fromRectangle(newRect);
169+
}
165170

166171
stats.scales[Scale::Type::X].range = boundRect.hSize();
167172
stats.scales[Scale::Type::Y].range = boundRect.vSize();

0 commit comments

Comments
 (0)