File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,19 @@ bool displayio_area_empty(const displayio_area_t *a) {
320
320
return (a -> x1 == a -> x2 ) || (a -> y1 == a -> y2 );
321
321
}
322
322
323
+ void displayio_area_canon (displayio_area_t * a ) {
324
+ if (a -> x1 < a -> x2 ) {
325
+ int16_t t = a -> x1 ;
326
+ a -> x1 = a -> x2 ;
327
+ a -> x2 = t ;
328
+ }
329
+ if (a -> y1 < a -> y2 ) {
330
+ int16_t t = a -> y1 ;
331
+ a -> y1 = a -> y2 ;
332
+ a -> y2 = t ;
333
+ }
334
+ }
335
+
323
336
void displayio_area_union (const displayio_area_t * a ,
324
337
const displayio_area_t * b ,
325
338
displayio_area_t * u ) {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ extern displayio_buffer_transform_t null_transform;
55
55
56
56
bool displayio_area_empty (const displayio_area_t * a );
57
57
void displayio_area_copy_coords (const displayio_area_t * src , displayio_area_t * dest );
58
+ void displayio_area_canon (displayio_area_t * a );
58
59
void displayio_area_union (const displayio_area_t * a ,
59
60
const displayio_area_t * b ,
60
61
displayio_area_t * u );
You can’t perform that action at this time.
0 commit comments