fix regression in xschem raw_read_from_attr when invoked from launcher

This commit is contained in:
stefan schippers 2024-02-22 14:36:34 +01:00
parent 446c0d687a
commit 965bf381ea
3 changed files with 6 additions and 3 deletions

View File

@ -1717,9 +1717,7 @@ void launcher(void)
if(xctx->lastsel ==1 && xctx->sel_array[0].type==ELEMENT)
{
double mx=xctx->mousex, my=xctx->mousey;
select_object(mx,my,SELECTED, 0);
tcleval("update; after 300");
select_object(mx,my,0, 0);
/* select_object(mx,my,SELECTED, 0); */
n=xctx->sel_array[0].n;
my_strncpy(program, get_tok_value(xctx->inst[n].prop_ptr,"program",0), S(program)); /* handle backslashes */
url = get_tok_value(xctx->inst[n].prop_ptr,"url",0); /* handle backslashes */
@ -1732,6 +1730,8 @@ void launcher(void)
tcleval(program);
}
}
tcleval("update; after 300");
select_object(mx,my,0, 0);
}
}

View File

@ -2994,6 +2994,7 @@ int embed_rawfile(const char *rawfile)
size_t len;
char *ptr;
dbg(1, "embed_rawfile(): rawfile=%s\n", rawfile);
if(xctx->lastsel==1 && xctx->sel_array[0].type==ELEMENT) {
xInstance *i = &xctx->inst[xctx->sel_array[0].n];
xctx->push_undo();

View File

@ -783,6 +783,8 @@ char *base64_from_file(const char *f, size_t *length)
return b64s;
}
/* "spice_data" attribute is set on instance by executing 'xschem embed_rawfile'
* after seletcing the component */
int raw_read_from_attr(Raw **rawptr, const char *type, double sweep1, double sweep2)
{
int res = 0;