Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable display size #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/hagl.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ typedef struct {
int16_t y0;
} tjpgd_iodev_t;

static window_t clip_window = {
.x0 = 0,
.y0 = 0,
.x1 = DISPLAY_WIDTH - 1,
.y1 = DISPLAY_HEIGHT - 1,
};
#ifdef HAGL_HAS_HAL_VARIABLE_DISPLAY_SIZE
static window_t clip_window;
#else
static window_t clip_window = {
.x0 = 0,
.y0 = 0,
.x1 = DISPLAY_WIDTH - 1,
.y1 = DISPLAY_HEIGHT - 1,
};
#endif

void hagl_set_clip_window(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
clip_window.x0 = x0;
Expand Down