Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
34 lines (25 loc) · 900 Bytes

File metadata and controls

34 lines (25 loc) · 900 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "shared-bindings/vectorio/Rectangle.h"
#include "shared-module/displayio/area.h"
#include "py/runtime.h"
void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_t width, uint32_t height) {
self->width = width;
self->height = height;
}
uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y) {
vectorio_rectangle_t *self = obj;
if (x < 0 || x > self->width || y > self->height || y < 0) {
return 0;
}
return 1;
}
void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area) {
vectorio_rectangle_t *self = rectangle;
out_area->x1 = -1;
out_area->y1 = -1;
out_area->x2 = self->width;
out_area->y2 = self->height;
}
uint32_t common_hal_vectorio_rectangle_get_height(void *rectangle) {
vectorio_rectangle_t *self = rectangle;
return self->height;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.