]> git.cworth.org Git - apitrace/blobdiff - gui/imageviewer.cpp
gui: fix pixel info on flipped images
[apitrace] / gui / imageviewer.cpp
index eced83b63dd3eba1ae64fc36ced0c512e71b1a9d..867fa61a48cf31ed540616ca8b03b4b5e630ee30 100644 (file)
@@ -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<unsigned char>(m_image, x, y);
     } else {