summaryrefslogtreecommitdiff
path: root/src/GipfelWidget.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-26 18:05:47 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-06-26 18:05:47 +0200
commit70a6e7c52eb8830e7e2c5884247201defdeb6a1c (patch)
tree17ae0ceb48ef1e5f3d2503539f69e382d7ff576e /src/GipfelWidget.cxx
parent76daa38e38aff35613dcaf18330192833fd83deb (diff)
switch to double coordinates
Diffstat (limited to 'src/GipfelWidget.cxx')
-rw-r--r--src/GipfelWidget.cxx9
1 files changed, 6 insertions, 3 deletions
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);
}