forked from pebble/pebblejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add src/util/graphics_text.h with graphics_text_attributes_enable_pag…
…ing_on_layer
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <pebble.h> | ||
|
||
#define TEXT_FLOW_DEFAULT_INSET 8 | ||
|
||
static inline void graphics_text_attributes_enable_paging_on_layer( | ||
GTextAttributes *text_attributes, const Layer *layer, const GRect *box, const int inset) { | ||
graphics_text_attributes_enable_screen_text_flow(text_attributes, inset); | ||
const GPoint origin_on_screen = layer_convert_point_to_screen(layer, box->origin); | ||
const GRect paging_on_screen = | ||
layer_convert_rect_to_screen(layer, (GRect) { .size = layer_get_bounds(layer).size }); | ||
graphics_text_attributes_enable_paging(text_attributes, origin_on_screen, paging_on_screen); | ||
} | ||
|