Skip to content

Commit 1d4ef89

Browse files
committed
Remove exception
1 parent a7cc3b0 commit 1d4ef89

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/chart/rendering/drawmarkerinfo.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,10 @@ DrawMarkerInfo::DrawMarkerInfo(const Layout &layout,
202202
plot(plot),
203203
style(plot.getStyle().tooltip)
204204
{
205-
auto coordSys = Draw::CoordinateSystem(layout.plotArea,
205+
coordSystem.emplace(layout.plotArea,
206206
plot.getOptions()->angle,
207207
plot.getOptions()->coordSystem,
208208
plot.keepAspectRatio);
209-
coordSystem = &coordSys;
210209
for (const auto &info : plot.getMarkersInfo()) {
211210
if (info.second.count == 0) continue;
212211
auto weight1 = info.second.values[0].weight;
@@ -224,9 +223,6 @@ DrawMarkerInfo::DrawMarkerInfo(const Layout &layout,
224223
fadeOutMarkerInfo(cnt1, weight1);
225224
else if (cnt1 && cnt2)
226225
moveMarkerInfo(cnt1, weight1, cnt2, weight2);
227-
else
228-
throw std::logic_error(
229-
"invalid marker info combination");
230226
}
231227
}
232228
}

src/chart/rendering/drawmarkerinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DrawMarkerInfo
4848
const Layout &layout;
4949
Gfx::ICanvas &canvas;
5050
const Gen::Plot &plot;
51-
Draw::CoordinateSystem *coordSystem{};
51+
std::optional<Draw::CoordinateSystem> coordSystem;
5252
const Styles::Tooltip &style;
5353

5454
void fadeInMarkerInfo(Content &cnt, double weight);

0 commit comments

Comments
 (0)