summaryrefslogtreecommitdiff
path: root/src/Stitch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Stitch.cxx')
-rw-r--r--src/Stitch.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index 49d2c77..0038b28 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -122,6 +122,10 @@ Stitch::resample(GipfelWidget::sample_mode_t m,
if (gipf[i]->get_pixel(m, a_view, a_nick,
&r, &g, &b) == 0) {
+ r = MAX(MIN(r, MAX_VALUE), 0);
+ g = MAX(MIN(g, MAX_VALUE), 0);
+ b = MAX(MIN(b, MAX_VALUE), 0);
+
if (single_images[i]) {
single_images[i]->set_pixel(x, r, g, b);
}