summaryrefslogtreecommitdiff
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
parent5c9d54d05b35f3f06261f8bf9c3a48d2293df767 (diff)
downloadnetsurf-4ae27a65929a5fe333dc9f9f0d43ac91a72a0116.tar.gz
netsurf-4ae27a65929a5fe333dc9f9f0d43ac91a72a0116.tar.bz2
remove scaling from internal browser get_dimensions calls
-rw-r--r--desktop/browser_private.h6
-rw-r--r--desktop/browser_window.c20
-rw-r--r--desktop/frames.c4
3 files changed, 18 insertions, 12 deletions
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index a5a6dcc9c..68487ea80 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -254,10 +254,10 @@ nserror browser_window_initialise_common(enum browser_window_create_flags flags,
* \param bw The browser window to get dimensions of
* \param width Updated to the browser window viewport width
* \param height Updated to the browser window viewport height
- * \param scaled Whether we want the height with scale applied
+ * \return NSERROR_OK and width and height updated otherwise error code
*/
-void browser_window_get_dimensions(struct browser_window *bw,
- int *width, int *height, bool scaled);
+nserror browser_window_get_dimensions(struct browser_window *bw,
+ int *width, int *height);
/**
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;
}
diff --git a/desktop/frames.c b/desktop/frames.c
index ebc54c6d5..1ed114540 100644
--- a/desktop/frames.c
+++ b/desktop/frames.c
@@ -436,7 +436,9 @@ void browser_window_recalculate_frameset(struct browser_window *bw)
/* window dimensions */
if (!bw->parent) {
- browser_window_get_dimensions(bw, &bw_width, &bw_height, true);
+ browser_window_get_dimensions(bw, &bw_width, &bw_height);
+ bw_width /= bw->scale;
+ bw_height /= bw->scale;
bw->x = 0;
bw->y = 0;
bw->width = bw_width;