From 7e4973c5b1ed6a894001848212fee567f379597e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 4 Dec 2021 21:52:25 +0100 Subject: [PATCH] profile: don't show "base line" for axes without labels/grid The axes are implemented by a line, which determines the position. For axes without labels/grids this looks ominous. For now, make the line invisible. But really, this should be changed. Signed-off-by: Berthold Stoeger --- profile-widget/divecartesianaxis.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/profile-widget/divecartesianaxis.cpp b/profile-widget/divecartesianaxis.cpp index 4db33d861..61ad1c4c1 100644 --- a/profile-widget/divecartesianaxis.cpp +++ b/profile-widget/divecartesianaxis.cpp @@ -57,6 +57,12 @@ DiveCartesianAxis::DiveCartesianAxis(Position position, bool inverted, int integ } std::tie(labelWidth, labelHeight) = DiveTextItem::getLabelSize(dpr, labelScale, label); + + // The axis is implemented by a line, which gives the position. + // If we don't show labels or grid, we don't want to show the line, + // as this gives a strange artifact. TODO: Don't derive from a + // line object in the first place. + setVisible(textVisible || linesVisible); } DiveCartesianAxis::~DiveCartesianAxis()