Skip to content

Commit fc44cd0

Browse files
committed
canvas restore
1 parent d3df253 commit fc44cd0

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/com/jsoftware/jn/wd/Glcmds.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public int glclear2(boolean clear)
169169
if (0!=glfont0("profont")) return 1;
170170
andunderline = 0;
171171
andfontangle = 0;
172-
andclipped= 0;
172+
andclipped = 0;
173173
andorgx = 0;
174174
andorgy = 0;
175175
andpenrgb = andrgb;
@@ -350,7 +350,7 @@ public int uiglcmds(int[] buf)
350350
rc=appendsbuf(buf, p, cnt);
351351
break;
352352
}
353-
andclipped= 1;
353+
andclipped += 1;
354354
canvas.save();
355355
canvas.clipRect(buf[p + 2],buf[p + 3],buf[p + 2]+buf[p + 4],buf[p + 3]+buf[p + 5]);
356356
break;
@@ -365,9 +365,11 @@ public int uiglcmds(int[] buf)
365365
rc=appendsbuf(buf, p, cnt);
366366
break;
367367
}
368-
andclipped= 0;
369-
canvas.clipRect(0,0,view.getWidth(),view.getHeight());
370-
canvas.restore();
368+
if (andclipped>0){
369+
andclipped -= 1;
370+
canvas.clipRect(0,0,view.getWidth(),view.getHeight());
371+
canvas.restore();
372+
}
371373
break;
372374

373375
case 2999 : // glcmds

0 commit comments

Comments
 (0)