Skip to content

Commit

Permalink
remove marker alpha on tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
schaumb committed Jan 29, 2024
1 parent 33ef62b commit 491f110
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
were not escaped properly.
- Fix dimension label transition on axis and legend.
- Through event handler call, when a new event handler is registered, undefined behaviour happened.
- Removed marker's alpha color when tooltip is shown.

### Added

Expand Down
22 changes: 0 additions & 22 deletions src/chart/rendering/markerrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,28 +403,6 @@ std::pair<Gfx::Color, Gfx::Color> MarkerRenderer::getColor(
auto finalBorderColor = actBorderColor * alpha;
auto itemColor = selectedColor * alpha * fillAlpha;

double highlight = 0.0;
double anyHighlight = 0.0;
auto markerInfo = plot->getMarkersInfo();
for (auto &info : markerInfo) {
auto allHighlight = 0.0;
info.second.visit(
[&highlight,
&allHighlight,
idx = abstractMarker.marker.idx](int,
const auto &info)
{
highlight += info.value.markerId == idx ? 1.0 : 0.0;
if (info.value.markerId.has_value())
allHighlight += info.weight;
});
anyHighlight = std::max(anyHighlight, allHighlight);
}

auto highlightAlpha = 1 - (0.65 * anyHighlight) * (1 - highlight);
finalBorderColor = (finalBorderColor * highlightAlpha);
itemColor = (itemColor * highlightAlpha);

return std::make_pair(finalBorderColor, itemColor);
}

Expand Down

0 comments on commit 491f110

Please sign in to comment.