replclipr.c 421 B

123456789101112131415161718192021222324
  1. #include "lib9.h"
  2. #include "draw.h"
  3. void
  4. replclipr(Image *i, int repl, Rectangle clipr)
  5. {
  6. uchar *b;
  7. b = bufimage(i->display, 22);
  8. if (b == 0) {
  9. _drawprint(2, "replclipr: no bufimage\n");
  10. return;
  11. }
  12. b[0] = 'c';
  13. BPLONG(b+1, i->id);
  14. repl = repl!=0;
  15. b[5] = repl;
  16. BPLONG(b+6, clipr.min.x);
  17. BPLONG(b+10, clipr.min.y);
  18. BPLONG(b+14, clipr.max.x);
  19. BPLONG(b+18, clipr.max.y);
  20. i->repl = repl;
  21. i->clipr = clipr;
  22. }