Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/fa64763b0d8c6566eda5f6547e7f2f3e62b77613
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/fa64763b0d8c6566eda5f6547e7f2f3e62b77613
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/fa64763b0d8c6566eda5f6547e7f2f3e62b77613

The branch, master has been updated
       via  fa64763b0d8c6566eda5f6547e7f2f3e62b77613 (commit)
      from  6c951f7a15a46763992685aae238cdab44483cce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=fa64763b0d8c6566eda5f6547e7f2f3e62b77613
commit fa64763b0d8c6566eda5f6547e7f2f3e62b77613
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    browser_history.c: Clamp contents to be 1x1 at min.
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index d9db0eb..ad9c501 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -456,11 +456,19 @@ nserror browser_window_history_update(struct 
browser_window *bw,
 
        if (bw->window != NULL &&
            guit->window->get_scroll(bw->window, &sx, &sy)) {
+               int content_height = content_get_height(content);
+               int content_width = content_get_width(content);
+               if (content_height < 1) {
+                       content_height = 1;
+               }
+               if (content_width < 1) {
+                       content_height = 1;
+               }
                /* Successfully got scroll offsets, update the entry */
                history->current->page.scroll_x = \
-                       (float)sx / (float)content_get_width(content);
+                       (float)sx / (float)content_width;
                history->current->page.scroll_y = \
-                       (float)sy / (float)content_get_height(content);
+                       (float)sy / (float)content_height;
                NSLOG(netsurf, INFO, "Updated scroll offsets to %g by %g",
                      history->current->page.scroll_x,
                      history->current->page.scroll_y);


-----------------------------------------------------------------------

Summary of changes:
 desktop/browser_history.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index d9db0eb..ad9c501 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -456,11 +456,19 @@ nserror browser_window_history_update(struct 
browser_window *bw,
 
        if (bw->window != NULL &&
            guit->window->get_scroll(bw->window, &sx, &sy)) {
+               int content_height = content_get_height(content);
+               int content_width = content_get_width(content);
+               if (content_height < 1) {
+                       content_height = 1;
+               }
+               if (content_width < 1) {
+                       content_height = 1;
+               }
                /* Successfully got scroll offsets, update the entry */
                history->current->page.scroll_x = \
-                       (float)sx / (float)content_get_width(content);
+                       (float)sx / (float)content_width;
                history->current->page.scroll_y = \
-                       (float)sy / (float)content_get_height(content);
+                       (float)sy / (float)content_height;
                NSLOG(netsurf, INFO, "Updated scroll offsets to %g by %g",
                      history->current->page.scroll_x,
                      history->current->page.scroll_y);


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to