summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-05-15 14:33:17 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-05-15 14:33:17 +0100
commitb31b66be4738c7d8ca1acdc663378fbd42c214ac (patch)
treeb55dacacf47289f32a23b6e3d8fe8941e7bdd0ea /windows
parent5da7f7e299a7d28877c4009aaa8b346b85a09de8 (diff)
downloadnetsurf-b31b66be4738c7d8ca1acdc663378fbd42c214ac.tar.gz
netsurf-b31b66be4738c7d8ca1acdc663378fbd42c214ac.tar.bz2
Use clean interface to get bw extents.
Avoids dereffing bw, and using the content_* api.
Diffstat (limited to 'windows')
-rw-r--r--windows/drawable.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/windows/drawable.c b/windows/drawable.c
index cfeb4d508..3a6a7ff10 100644
--- a/windows/drawable.c
+++ b/windows/drawable.c
@@ -73,6 +73,7 @@ nsws_drawable_wheel(struct gui_window *gw, HWND hwnd, WPARAM wparam)
static LRESULT
nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
{
+ int width, height;
SCROLLINFO si;
int mem;
@@ -120,10 +121,10 @@ nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
}
si.fMask = SIF_POS;
- if ((gw->bw != NULL) && (gw->bw->current_content != NULL)) {
- si.nPos = min(si.nPos,
- content_get_height(gw->bw->current_content) *
- gw->bw->scale - gw->height);
+ if ((gw->bw != NULL) &&
+ (browser_window_get_extents(gw->bw, true,
+ &width, &height) == NSERROR_OK)) {
+ si.nPos = min(si.nPos, height - gw->height);
}
si.nPos = max(si.nPos, 0);
@@ -144,6 +145,7 @@ nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
static LRESULT
nsws_drawable_hscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
{
+ int width, height;
SCROLLINFO si;
int mem;
@@ -184,10 +186,10 @@ nsws_drawable_hscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
si.fMask = SIF_POS;
- if ((gw->bw != NULL) && (gw->bw->current_content != NULL)) {
- si.nPos = min(si.nPos,
- content_get_width(gw->bw->current_content) *
- gw->bw->scale - gw->width);
+ if ((gw->bw != NULL) &&
+ (browser_window_get_extents(gw->bw, true,
+ &width, &height) == NSERROR_OK)) {
+ si.nPos = min(si.nPos, width - gw->width);
}
si.nPos = max(si.nPos, 0);
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);