summaryrefslogtreecommitdiff
path: root/content/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers')
-rw-r--r--content/handlers/html/html_object.c47
-rw-r--r--content/handlers/image/gif.c24
2 files changed, 17 insertions, 54 deletions
diff --git a/content/handlers/html/html_object.c b/content/handlers/html/html_object.c
index 37bf29faf..223f5516d 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -191,7 +191,6 @@ html_object_callback(hlcache_handle *object,
data.redraw.y = y + box->padding[TOP];
data.redraw.width = box->width;
data.redraw.height = box->height;
- data.redraw.full_redraw = true;
content_broadcast(&c->base, CONTENT_MSG_REDRAW, &data);
}
@@ -289,53 +288,39 @@ html_object_callback(hlcache_handle *object,
break;
}
- data.redraw.object_width = box->width;
- data.redraw.object_height = box->height;
-
/* Add offset to box */
data.redraw.x += x;
data.redraw.y += y;
- data.redraw.object_x += x;
- data.redraw.object_y += y;
-
- content_broadcast(&c->base,
- CONTENT_MSG_REDRAW, &data);
- break;
} else {
/* Non-background case */
- if (hlcache_handle_get_content(object) ==
- event->data.redraw.object) {
-
- int w = content_get_width(object);
- int h = content_get_height(object);
-
- if (w != 0) {
- data.redraw.x =
- data.redraw.x *
+ int w = content_get_width(object);
+ int h = content_get_height(object);
+
+ if (w != 0 && box->width != w) {
+ /* Not showing image at intrinsic
+ * width; need to scale the redraw
+ * request area. */
+ data.redraw.x = data.redraw.x *
box->width / w;
- data.redraw.width =
+ data.redraw.width =
data.redraw.width *
box->width / w;
- }
+ }
- if (h != 0) {
- data.redraw.y =
- data.redraw.y *
+ if (h != 0 && box->height != w) {
+ /* Not showing image at intrinsic
+ * height; need to scale the redraw
+ * request area. */
+ data.redraw.y = data.redraw.y *
box->height / h;
- data.redraw.height =
+ data.redraw.height =
data.redraw.height *
box->height / h;
- }
-
- data.redraw.object_width = box->width;
- data.redraw.object_height = box->height;
}
data.redraw.x += x + box->padding[LEFT];
data.redraw.y += y + box->padding[TOP];
- data.redraw.object_x += x + box->padding[LEFT];
- data.redraw.object_y += y + box->padding[TOP];
}
content_broadcast(&c->base, CONTENT_MSG_REDRAW, &data);
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c
index 94f8d3f62..fa343fbac 100644
--- a/content/handlers/image/gif.c
+++ b/content/handlers/image/gif.c
@@ -173,11 +173,9 @@ static void nsgif_animate(void *p)
/* redraw background (true) or plot on top (false) */
if (gif->current_frame > 0) {
- data.redraw.full_redraw =
- gif->gif->frames[f - 1].redraw_required;
/* previous frame needed clearing: expand the redraw area to
* cover it */
- if (data.redraw.full_redraw) {
+ if (gif->gif->frames[f - 1].redraw_required) {
if (data.redraw.x >
(int)(gif->gif->frames[f - 1].redraw_x)) {
data.redraw.width += data.redraw.x -
@@ -207,28 +205,8 @@ static void nsgif_animate(void *p)
data.redraw.y +
gif->gif->frames[f - 1].redraw_height;
}
- } else {
- /* do advanced check */
- if ((data.redraw.x == 0) && (data.redraw.y == 0) &&
- (data.redraw.width == (int)(gif->gif->width)) &&
- (data.redraw.height == (int)(gif->gif->height))) {
- data.redraw.full_redraw = !gif->gif->frames[f].opaque;
- } else {
- data.redraw.full_redraw = true;
- data.redraw.x = 0;
- data.redraw.y = 0;
- data.redraw.width = gif->gif->width;
- data.redraw.height = gif->gif->height;
- }
}
- /* other data */
- data.redraw.object = (struct content *) gif;
- data.redraw.object_x = 0;
- data.redraw.object_y = 0;
- data.redraw.object_width = gif->base.width;
- data.redraw.object_height = gif->base.height;
-
content_broadcast(&gif->base, CONTENT_MSG_REDRAW, &data);
}