From: Zack Rusin Date: Fri, 11 Oct 2013 22:32:25 +0000 (-0400) Subject: gui: fix pixel info on flipped images X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=7ec54f936be0ac8d7fade4df133c4b1009e5782a gui: fix pixel info on flipped images Flipped images were still using the original image instead of flipping the coordinates, thus returning the wrong data. Let's just flip the y-axis to find the right location in the original image. --- diff --git a/gui/imageviewer.cpp b/gui/imageviewer.cpp index eced83b..867fa61 100644 --- a/gui/imageviewer.cpp +++ b/gui/imageviewer.cpp @@ -151,6 +151,11 @@ void ImageViewer::showPixel(int x, int y) QString label = tr("Pixel: "); + /* If the image is flipped, substitute y to match */ + if (flipCheckBox->isChecked()) { + y = m_convertedImage.height() - y - 1; + } + if (m_image->channelType == image::TYPE_UNORM8) { label += createPixelLabel(m_image, x, y); } else {