From 9c5632cd44eaf3cae42fbc50be4c8c061299dc96 Mon Sep 17 00:00:00 2001
From: "p.kosyh"
Date: Sun, 31 Oct 2010 06:40:26 +0000
Subject: [PATCH] cleanups
---
src/sdl-instead/graphics.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/sdl-instead/graphics.c b/src/sdl-instead/graphics.c
index a7b04a3..e77072e 100644
--- a/src/sdl-instead/graphics.c
+++ b/src/sdl-instead/graphics.c
@@ -2448,7 +2448,8 @@ void xref_update(xref_t pxref, int x, int y, clear_fn clear, update_fn update)
for (i = 0; i < xref->num; i ++) {
word = xref->words[i];
- word_image_render(word, x, y, clear, update);
+ if (!word->img_align)
+ word_image_render(word, x, y, clear, update);
}
gfx_noclip();
}
@@ -2742,9 +2743,9 @@ xref_t txt_box_xrefs(textbox_t tbox)
break; /* bottom */
for (word = line->words; word; word = word->next) {
xref = word->xref;
- if (!xref)
+ if (!xref || word->img_align)
continue;
- return xref;
+ return xref;
}
}
return xref;
@@ -3340,13 +3341,16 @@ int xref_position(xref_t x, int *xc, int *yc)
for (i = 0; i < xref->num; i ++) {
word = xref->words[i];
- w += word->w;
+ if (!word->img_align)
+ w += word->w;
}
w = w/2;
for (i = 0; i < xref->num; i ++) {
word = xref->words[i];
+ if (word->img_align)
+ continue;
line = word->line;
w -= word->w;
if (w < 0)
@@ -3376,6 +3380,8 @@ xref_t txt_layout_xref(layout_t lay, int x, int y)
int hh,yy;
word = xref->words[i];
line = word->line;
+ if (word->img_align)
+ continue;
if (y < line->y || y > line->y + line->h)
continue;
yy = vertical_align(word, &hh);