remove scaling from internal browser get_dimensions calls

This commit is contained in:
Vincent Sanders 2019-08-02 11:52:56 +01:00
parent 5c9d54d05b
commit 4ae27a6592
3 changed files with 18 additions and 12 deletions

View File

@ -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);
/**

View File

@ -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;
}

View File

@ -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;