From 254145c0b69e397156dcaab54c2afede4c166f68 Mon Sep 17 00:00:00 2001 From: anjok Date: Tue, 1 Aug 2023 08:15:48 +0200 Subject: [PATCH] eoszoomposition now scaled correctly (#812) --- indi-gphoto/gphoto_ccd.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/indi-gphoto/gphoto_ccd.cpp b/indi-gphoto/gphoto_ccd.cpp index e4dc5852e..671777ddc 100644 --- a/indi-gphoto/gphoto_ccd.cpp +++ b/indi-gphoto/gphoto_ccd.cpp @@ -499,7 +499,19 @@ bool GPhotoCCD::ISNewText(const char * dev, const char * name, char * texts[], c if (IUUpdateText(&opt->prop.text, texts, names, n) < 0) return false; - gphoto_set_widget_text(gphotodrv, opt->widget, texts[0]); + char *text = texts[0]; + char buf[256]; + if(strcmp("eoszoomposition", name) == 0) { + int x = 0, y = 0; + LOGF_DEBUG("%s %s", name, text); + sscanf(text, "%d,%d", &x, &y); + x *= 5; + y *= 5; + sprintf(buf, "%d,%d", x, y); + text = buf; + LOGF_DEBUG("%s adjusted %s %s (%d,%d)", name, text, buf, x, y); + } + gphoto_set_widget_text(gphotodrv, opt->widget, text); opt->prop.num.s = IPS_OK; IDSetText(&opt->prop.text, nullptr); return true;