Skip to content

Commit 9947054

Browse files
committed
2 parents 61b9a20 + 9fa51a5 commit 9947054

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/gui/ImagePanel.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,11 @@ private void notifyListeners() {
563563
int x = (int) ((currentMousePosition.getX() - getDrawX()) * invZoom);
564564
int y = (int) ((currentMousePosition.getY() - getDrawY()) * invZoom);
565565

566-
if (x >= 0 && x < buffer.xResolution && y >= 0
567-
&& y < buffer.yResolution && finished[y][x]) {
568-
RGBSpectrum spectrum = buffer.getPixel(x, y).getSpectrum();
566+
int yy = buffer.yResolution - y - 1;
567+
568+
if (x >= 0 && x < buffer.xResolution && yy >= 0
569+
&& yy < buffer.yResolution && finished[yy][x]) {
570+
RGBSpectrum spectrum = buffer.getPixel(x, yy).getSpectrum();
569571

570572
for (ImagePanelListener listener : listeners)
571573
listener.spectrumAtMouseChanged(spectrum);

0 commit comments

Comments
 (0)