Skip to content

Commit

Permalink
fix overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed May 3, 2024
1 parent 0c31327 commit bbbac49
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private static RandomAccessibleInterval<UnsignedByteType> applyShifts(
RandomAccessibleInterval<UnsignedByteType> convertedLayer = Converters.convert(layer, (s, t) -> {
// only shift foreground
if (s.get() > 0) {
t.set(s.get() - shift);
t.set( Math.max(0, Math.min( 255, s.get() - shift)));
} else {
t.set(0);
}
Expand Down

0 comments on commit bbbac49

Please sign in to comment.