ensure drawline/drawrect proper buffer initialization before drawing moved/copied texts

This commit is contained in:
Stefan Schippers 2020-08-29 12:34:52 +02:00
parent 54e533e3a2
commit b4477d877a
1 changed files with 12 additions and 1 deletions

View File

@ -745,7 +745,12 @@ void copy_objects(int what)
textlayer = textelement[lasttext].layer; /* 20171206 */
if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
#ifndef HAS_CAIRO
if(textlayer > k) { /* ensure BEGIN is executed, if textlayer<=k already done at beginning of for(k) loop */
drawrect(textlayer, BEGIN, 0.0, 0.0, 0.0, 0.0);
drawline(textlayer, BEGIN, 0.0, 0.0, 0.0, 0.0);
}
#endif
#ifdef HAS_CAIRO
textfont = textelement[lasttext].font; /* 20171206 */
if(textfont && textfont[0]) {
@ -1214,6 +1219,12 @@ void move_objects(int what, int merge, double dx, double dy)
textlayer = textelement[n].layer; /* 20171206 */
if(textlayer < 0 || textlayer >= cadlayers) textlayer = TEXTLAYER;
#ifndef HAS_CAIRO
if(textlayer > k) { /* ensure BEGIN is executed, if textlayer<=k already done at beginning of for(k) loop */
drawrect(textlayer, BEGIN, 0.0, 0.0, 0.0, 0.0);
drawline(textlayer, BEGIN, 0.0, 0.0, 0.0, 0.0);
}
#endif
#ifdef HAS_CAIRO
textfont = textelement[n].font; /* 20171206 */
if(textfont && textfont[0]) {