summaryrefslogtreecommitdiff
path: root/frontends/monkey/layout.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-06-09 22:04:58 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-06-10 12:54:57 +0100
commitfe9104096fd8de9f79338f750a13e0ddccf05429 (patch)
tree029e144c6035e7f8d6825a933691892c8f9b9726 /frontends/monkey/layout.c
parent7272b59458c02286e1d246ffa09de7386f0d942e (diff)
downloadnetsurf-fe9104096fd8de9f79338f750a13e0ddccf05429.tar.gz
netsurf-fe9104096fd8de9f79338f750a13e0ddccf05429.tar.bz2
Reflow monkey code, it was annoying me too much
Diffstat (limited to 'frontends/monkey/layout.c')
-rw-r--r--frontends/monkey/layout.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/frontends/monkey/layout.c b/frontends/monkey/layout.c
index 4bcc51b68..7b7223144 100644
--- a/frontends/monkey/layout.c
+++ b/frontends/monkey/layout.c
@@ -30,11 +30,11 @@
#include "monkey/layout.h"
static nserror nsfont_width(const plot_font_style_t *fstyle,
- const char *string, size_t length,
- int *width)
+ const char *string, size_t length,
+ int *width)
{
- *width = (fstyle->size * utf8_bounded_length(string, length)) / FONT_SIZE_SCALE;
- return NSERROR_OK;
+ *width = (fstyle->size * utf8_bounded_length(string, length)) / FONT_SIZE_SCALE;
+ return NSERROR_OK;
}
/**
@@ -50,14 +50,14 @@ static nserror nsfont_width(const plot_font_style_t *fstyle,
*/
static nserror nsfont_position_in_string(const plot_font_style_t *fstyle,
- const char *string, size_t length,
- int x, size_t *char_offset, int *actual_x)
+ const char *string, size_t length,
+ int x, size_t *char_offset, int *actual_x)
{
- *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
- if (*char_offset > length)
- *char_offset = length;
- *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
- return NSERROR_OK;
+ *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
+ if (*char_offset > length)
+ *char_offset = length;
+ *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
+ return NSERROR_OK;
}
@@ -85,27 +85,27 @@ static nserror nsfont_position_in_string(const plot_font_style_t *fstyle,
*/
static nserror nsfont_split(const plot_font_style_t *fstyle,
- const char *string, size_t length,
- int x, size_t *char_offset, int *actual_x)
+ const char *string, size_t length,
+ int x, size_t *char_offset, int *actual_x)
{
- int c_off = *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
- if (*char_offset > length) {
- *char_offset = length;
- } else {
- while (*char_offset > 0) {
- if (string[*char_offset] == ' ')
- break;
- (*char_offset)--;
- }
- if (*char_offset == 0) {
- *char_offset = c_off;
- while (*char_offset < length && string[*char_offset] != ' ') {
- (*char_offset)++;
- }
- }
- }
- *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
- return NSERROR_OK;
+ int c_off = *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
+ if (*char_offset > length) {
+ *char_offset = length;
+ } else {
+ while (*char_offset > 0) {
+ if (string[*char_offset] == ' ')
+ break;
+ (*char_offset)--;
+ }
+ if (*char_offset == 0) {
+ *char_offset = c_off;
+ while (*char_offset < length && string[*char_offset] != ' ') {
+ (*char_offset)++;
+ }
+ }
+ }
+ *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
+ return NSERROR_OK;
}
static struct gui_layout_table layout_table = {