- if ((role != SPI_ROLE_TABLE_CELL) /* XXX bug workaround */
- && !bounds_contain_y (&text_chunk->text_bounds,
- screen_y)) {
+ if (text_chunk->text_bounds.x < text_chunk->clip_bounds.x) {
+ text_chunk->text_bounds.x = text_chunk->clip_bounds.x;
+ text_chunk->text_bounds.isClipped = TRUE;
+ }
+ if ((text_chunk->text_bounds.x +
+ text_chunk->text_bounds.width)
+ > (text_chunk->clip_bounds.x +
+ text_chunk->clip_bounds.width)) {
+ text_chunk->text_bounds.width =
+ MAX (0, (text_chunk->clip_bounds.x +
+ text_chunk->clip_bounds.width) -
+ text_chunk->text_bounds.x);
+ text_chunk->text_bounds.isClipped = TRUE;
+ }
+ if (!BOUNDS_CONTAIN_Y (&text_chunk->text_bounds,
+ screen_y)) {
+#ifdef CLIP_DEBUG
+ fprintf (stderr, "%s out of bounds (%d-%d)\n", s,
+ text_chunk->text_bounds.y,
+ text_chunk->text_bounds.y +
+ text_chunk->text_bounds.height);
+#endif