Skip to content

Commit

Permalink
Add src/util/graphics_text.h with graphics_text_attributes_enable_pag…
Browse files Browse the repository at this point in the history
…ing_on_layer
  • Loading branch information
Meiguro committed Feb 14, 2016
1 parent 96f9bdb commit 35fa7a2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/util/graphics_text.h
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);
}

0 comments on commit 35fa7a2

Please sign in to comment.