reset floater caches on save(As) schematic - better done

This commit is contained in:
stefan schippers 2023-11-09 19:20:17 +01:00
parent 1b737c4ac7
commit 87f9a4e09b
2 changed files with 1 additions and 3 deletions

View File

@ -177,7 +177,7 @@ int set_modify(int mod)
} }
/* clear floater caches */ /* clear floater caches */
if(mod == 1 || mod == -2) { if(mod == 1 || mod == -2 || mod == -1) {
for(i = 0; i < xctx->texts; i++) for(i = 0; i < xctx->texts; i++)
if(xctx->text[i].flags & TEXT_FLOATER) { if(xctx->text[i].flags & TEXT_FLOATER) {
floaters++; floaters++;

View File

@ -2614,12 +2614,10 @@ int save_schematic(const char *schname) /* 20171020 added return value */
if(!xctx->sch[xctx->currsch]) { /* no current schematic name -> assign new name */ if(!xctx->sch[xctx->currsch]) { /* no current schematic name -> assign new name */
my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], schname); my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], schname);
set_modify(-1); /* set title to new filename */ set_modify(-1); /* set title to new filename */
set_modify(-2); /* clear floater caches */
} }
else if(strcmp(schname, xctx->sch[xctx->currsch])) { /* user asks to save to a different filename */ else if(strcmp(schname, xctx->sch[xctx->currsch])) { /* user asks to save to a different filename */
my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], schname); my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], schname);
set_modify(-1); /* set title to new filename */ set_modify(-1); /* set title to new filename */
set_modify(-2); /* clear floater caches */
} }
else { /* user asks to save to same filename */ else { /* user asks to save to same filename */
if(!stat(xctx->sch[xctx->currsch], &buf)) { if(!stat(xctx->sch[xctx->currsch], &buf)) {