Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1.  
  2. static struct viewport clip_rect;
  3. static bool clipped = false;
  4.  
  5. static void rb_clip(void *handle, int x, int y, int w, int h)
  6. {
  7. LOGF("rb_clip(%d %d %d %d)", x, y, w, h);
  8. clip_rect.x = x;
  9. clip_rect.y = y;
  10. clip_rect.width = w;
  11. clip_rect.height = h;
  12. clip_rect.font = FONT_UI;
  13. clip_rect.drawmode = DRMODE_SOLID;
  14. #if LCD_DEPTH > 1
  15. clip_rect.fg_pattern = LCD_DEFAULT_FG;
  16. clip_rect.bg_pattern = LCD_DEFAULT_BG;
  17. #endif
  18. rb->lcd_set_viewport(NULL);
  19. rb->lcd_set_viewport(&clip_rect);
  20. clipped = true;
  21. }
  22.  
  23. static void rb_unclip(void *handle)
  24. {
  25. LOGF("rb_unclip");
  26. rb->lcd_set_viewport(NULL);
  27. clipped = false;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement