summaryrefslogtreecommitdiff
path: root/desktop/browser_window.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-08-02 11:52:56 +0100
committerVincent Sanders <vince@kyllikki.org>2019-08-02 12:26:19 +0100
commit4ae27a65929a5fe333dc9f9f0d43ac91a72a0116 (patch)
tree311333ebefab44ac359197c47acf59747a8aa848 /desktop/browser_window.c
parent5c9d54d05b35f3f06261f8bf9c3a48d2293df767 (diff)
downloadnetsurf-4ae27a65929a5fe333dc9f9f0d43ac91a72a0116.tar.gz
netsurf-4ae27a65929a5fe333dc9f9f0d43ac91a72a0116.tar.bz2
remove scaling from internal browser get_dimensions calls
Diffstat (limited to 'desktop/browser_window.c')
-rw-r--r--desktop/browser_window.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 397c6f199..547c799f2 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -674,7 +674,9 @@ static nserror browser_window_content_ready(struct browser_window *bw)
bw->loading_content = NULL;
/* Format the new content to the correct dimensions */
- browser_window_get_dimensions(bw, &width, &height, true);
+ browser_window_get_dimensions(bw, &width, &height);
+ width /= bw->scale;
+ height /= bw->scale;
content_reformat(bw->current_content, false, width, height);
/* history */
@@ -974,10 +976,10 @@ browser_window_callback(hlcache_handle *c, const hlcache_event *event, void *pw)
int width;
int height;
- browser_window_get_dimensions(bw, &width, &height, true);
+ browser_window_get_dimensions(bw, &width, &height);
- *(event->data.getdims.viewport_width) = width;
- *(event->data.getdims.viewport_height) = height;
+ *(event->data.getdims.viewport_width) = width / bw->scale;
+ *(event->data.getdims.viewport_height) = height / bw->scale;
break;
}
@@ -2635,22 +2637,24 @@ nserror browser_window_get_extents(struct browser_window *bw, bool scaled,
/* exported internal interface, documented in desktop/browser_private.h */
-void
+nserror
browser_window_get_dimensions(struct browser_window *bw,
int *width,
- int *height,
- bool scaled)
+ int *height)
{
+ nserror res;
assert(bw);
if (bw->window == NULL) {
/* Core managed browser window */
*width = bw->width;
*height = bw->height;
+ res = NSERROR_OK;
} else {
/* Front end window */
- guit->window->get_dimensions(bw->window, width, height, scaled);
+ res = guit->window->get_dimensions(bw->window, width, height, false);
}
+ return res;
}