SHARE
TWEET

Untitled

a guest Nov 21st, 2016 2 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top