From 70a6e7c52eb8830e7e2c5884247201defdeb6a1c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 26 Jun 2006 18:05:47 +0200 Subject: switch to double coordinates --- src/GipfelWidget.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/GipfelWidget.cxx') diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index aac0b49..67695ad 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -749,16 +749,19 @@ GipfelWidget::handle(int event) { int GipfelWidget::get_pixel(double a_view, double a_nick, char *r, char *g, char *b) { - int px, py; + double px, py; if (img == NULL) { return 1; } - pan->get_coordinates(a_view, a_nick, &px, &py); + if (pan->get_coordinates(a_view, a_nick, &px, &py) != 0) { + return 1; + } //printf("===> %s: %f, %f -> %d %d\n", img_file, a_view, a_nick, px, py); - return DataImage::get_pixel(img, px + img->w() / 2, py + img->h() / 2, r, g, b); + return DataImage::get_pixel_nearest(img, px + ((double) img->w()) / 2.0, + py + ((double) img->h()) / 2.0, r, g, b); } -- cgit v1.2.3