From 3d30c9d3ed214495f6ce36abbb8a45ec03a4645b Mon Sep 17 00:00:00 2001 From: Dirk Vanden Boer Date: Mon, 15 Apr 2024 21:32:02 +0200 Subject: [PATCH] Add epsilon to legend min max to avoid transparent values at the edges --- deps/vcpkg | 2 +- legend.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/vcpkg b/deps/vcpkg index bea9d0f7..1a440c02 160000 --- a/deps/vcpkg +++ b/deps/vcpkg @@ -1 +1 @@ -Subproject commit bea9d0f76fcb24475af8f5a4e833bd76faafa397 +Subproject commit 1a440c0247474ae8f6cbec88ed76696828ccff8b diff --git a/legend.cpp b/legend.cpp index 5d41757a..1cc8aa59 100644 --- a/legend.cpp +++ b/legend.cpp @@ -120,7 +120,7 @@ Color Legend::color_for_value(double value, const Color& unmappable, const Color if (type == Type::Contiguous) { assert(entries.size() == 1); - if (value >= entries.front().lowerBound && value <= entries.front().upperBound) { + if (value >= (entries.front().lowerBound - 1e-4) && value <= (entries.front().upperBound + 1e-4)) { return cmap.get_color(linear_map_to_float(value, entries.front().lowerBound, entries.front().upperBound)); } } else {