Skip to content

Commit

Permalink
Add epsilon to legend min max to avoid transparent values at the edges
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Apr 15, 2024
1 parent 51b1726 commit 3d30c9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/vcpkg
Submodule vcpkg updated 390 files
2 changes: 1 addition & 1 deletion legend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3d30c9d

Please sign in to comment.