Skip to content

Commit

Permalink
eoszoomposition now scaled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
anjok committed Jul 5, 2023
1 parent 46cc15b commit ae2ffbc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion indi-gphoto/gphoto_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ae2ffbc

Please sign in to comment.