summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-08-04 21:46:18 +0100
committerVincent Sanders <vince@kyllikki.org>2019-08-04 21:46:18 +0100
commitbf0e6be9cad29ade1acd114f664af38f6de2f801 (patch)
tree665fa71a3c4876e9f85e1b071e022b508d8b6633
parent0aae3c370ba498d726eda40b71d2259c00f86a24 (diff)
downloadnetsurf-bf0e6be9cad29ade1acd114f664af38f6de2f801.tar.gz
netsurf-bf0e6be9cad29ade1acd114f664af38f6de2f801.tar.bz2
remove unecessary scaling in RISC OS get and set scroll offsets
-rw-r--r--frontends/riscos/window.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index 0a0faed51..f6ffdc415 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -3598,10 +3598,11 @@ static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
return false;
}
- if (g->toolbar)
+ if (g->toolbar) {
toolbar_height = ro_toolbar_full_height(g->toolbar);
- *sx = state.xscroll / (2 * g->scale);
- *sy = -(state.yscroll - toolbar_height) / (2 * g->scale);
+ }
+ *sx = state.xscroll / 2;
+ *sy = -(state.yscroll - toolbar_height) / 2;
return true;
}
@@ -3640,8 +3641,8 @@ gui_window_set_scroll(struct gui_window *g, const struct rect *rect)
if ((rect->x0 == rect->x1) && (rect->y0 == rect->y1)) {
/* scroll to top */
- state.xscroll = rect->x0 * 2 * g->scale;
- state.yscroll = (-rect->y0 * 2 * g->scale) + toolbar_height;
+ state.xscroll = rect->x0 * 2;
+ state.yscroll = (-rect->y0 * 2) + toolbar_height;
} else {
/* scroll area into view with padding */
int x0, y0, x1, y1;
@@ -3649,10 +3650,10 @@ gui_window_set_scroll(struct gui_window *g, const struct rect *rect)
int padding_available;
int correction;
- x0 = rect->x0 * 2 * g->scale;
- y0 = rect->y0 * 2 * g->scale;
- x1 = rect->x1 * 2 * g->scale;
- y1 = rect->y1 * 2 * g->scale;
+ x0 = rect->x0 * 2 ;
+ y0 = rect->y0 * 2 ;
+ x1 = rect->x1 * 2 ;
+ y1 = rect->y1 * 2 ;
cx0 = state.xscroll;
cy0 = -state.yscroll + toolbar_height;
@@ -3987,8 +3988,9 @@ gui_window_drag_start(struct gui_window *g,
switch (type) {
case GDRAGGING_SCROLLBAR:
/* Dragging a core scrollbar */
- ro_mouse_drag_start(ro_gui_window_scroll_end, ro_gui_window_mouse_at,
- NULL, g);
+ ro_mouse_drag_start(ro_gui_window_scroll_end,
+ ro_gui_window_mouse_at,
+ NULL, g);
break;
default: