summaryrefslogtreecommitdiff
path: root/content/handlers/html/html_object.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2019-11-11 21:34:46 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2019-11-11 21:54:15 +0000
commit8e1154eb1cef4e102504fae25fb9805040d37226 (patch)
tree92c1f50c04edf0d6ae741f671e1994df13150a8c /content/handlers/html/html_object.c
parentdb7f1f01a97cb9a26cbe6433542d7d6b25940929 (diff)
downloadnetsurf-8e1154eb1cef4e102504fae25fb9805040d37226.tar.gz
netsurf-8e1154eb1cef4e102504fae25fb9805040d37226.tar.bz2
Content: Remove redundant and unused redraw message fields.
This was archaic support for rendering images as "overlays", and avoiding a redraw via the browser window redraw and HTML contents. Basically it was "plot this image here", but it was too error prone, so it was removed a long time ago. These are some last vestiges that made the redraw message look more complex than it is.
Diffstat (limited to 'content/handlers/html/html_object.c')
-rw-r--r--content/handlers/html/html_object.c47
1 files changed, 16 insertions, 31 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);