From 9a7d70b84e36d7687185e76ec4053de7c9a838b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Sun, 10 Jan 2021 19:19:36 +0200
Subject: [PATCH 1/1] Cleanup
src/ui/documentwidget.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 6b83578d..423286ea 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2195,15 +2195,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
}
}
else if (ev->type == SDL_MOUSEWHEEL && isHover_Widget(w)) {
float acceleration = 1.0f;
const iInt2 mouseCoord = mouseCoord_Window(get_Window());
if (prefs_App()->hoverOutline &&
contains_Widget(constAs_Widget(d->scroll), mouseCoord)) {
const int outHeight = outlineHeight_DocumentWidget_(d);
if (outHeight > height_Rect(bounds_Widget(w))) {
acceleration = (float) size_GmDocument(d->doc).y / (float) outHeight;
}
}
#if defined (iPlatformApple)
/* On macOS, we handle both trackpad and mouse events. We expect SDL to identify
which device is sending the event. */
@@ -2217,7 +2209,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
else {
wheel.x = 0;
}
scroll_DocumentWidget_(d, -wheel.y * get_Window()->pixelRatio * acceleration);
scroll_DocumentWidget_(d, -wheel.y * get_Window()->pixelRatio);
scrollWideBlock_DocumentWidget_(d, mouseCoord, wheel.x * get_Window()->pixelRatio, 0);
}
else
@@ -2235,7 +2227,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
}
smoothScroll_DocumentWidget_(
d,
-3 * amount * lineHeight_Text(paragraph_FontId) * acceleration,
-3 * amount * lineHeight_Text(paragraph_FontId),
smoothDuration_DocumentWidget_ *
/* accelerated speed for repeated wheelings */
(!isFinished_Anim(&d->scrollY) && pos_Anim(&d->scrollY) < 0.25f ? 0.5f : 1.0f));
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).