summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-11-23 19:55:23 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-11-23 19:55:23 +0000
commit86351a44bb497dbab0ec6720c50b7892668c8f42 (patch)
treec8a8350be12c256d55a34f9690cba493d548e44b /pango/pango-layout.c
parentbb5b651edbc041fd9677b40a0fc2ff9b491a0371 (diff)
downloadpango-86351a44bb497dbab0ec6720c50b7892668c8f42.tar.gz
Remove cast to double in things like a = b / c where a, b, and c are all
2005-11-23 Behdad Esfahbod <behdad@gnome.org> * pango/mapping.c (pango_glyph_string_index_to_x), pango/pango-layout.c (pango_layout_iter_get_char_extents): Remove cast to double in things like a = b / c where a, b, and c are all ints. (#312469, Sven Neumann)
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 179d83d4..ad0302d7 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -4987,7 +4987,7 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
PangoRectangle *logical_rect)
{
PangoRectangle cluster_rect;
- double x0, x1;
+ int x0, x1;
if (IS_INVALID (iter))
return;
@@ -5008,13 +5008,13 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
g_assert (cluster_rect.width == iter->cluster_width);
- x0 = ((double)iter->character_position * cluster_rect.width) / iter->cluster_num_chars;
- x1 = ((double)(iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars;
+ x0 = (iter->character_position * cluster_rect.width) / iter->cluster_num_chars;
+ x1 = (iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars;
- logical_rect->width = (int)x1 - (int)x0;
+ logical_rect->width = x1 - x0;
logical_rect->height = cluster_rect.height;
logical_rect->y = cluster_rect.y;
- logical_rect->x = cluster_rect.x + (int)x0;
+ logical_rect->x = cluster_rect.x + x0;
}
/**