use std::fabs, hopefully fixes #5651
This commit is contained in:
parent
562b19bb5c
commit
30317f4133
@ -295,7 +295,7 @@ void CropWindow::flawnOver (bool isFlawnOver)
|
|||||||
void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, double deltaX, double deltaY)
|
void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, double deltaX, double deltaY)
|
||||||
{
|
{
|
||||||
double delta = 0.0;
|
double delta = 0.0;
|
||||||
if (abs(deltaX) > abs(deltaY)) {
|
if (std::fabs(deltaX) > std::fabs(deltaY)) {
|
||||||
delta = deltaX;
|
delta = deltaX;
|
||||||
} else {
|
} else {
|
||||||
delta = deltaY;
|
delta = deltaY;
|
||||||
@ -304,7 +304,7 @@ void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y,
|
|||||||
if (direction == GDK_SCROLL_SMOOTH) {
|
if (direction == GDK_SCROLL_SMOOTH) {
|
||||||
scrollAccum += delta;
|
scrollAccum += delta;
|
||||||
//Only change zoom level if we've accumulated +/- 1.0 of deltas. This conditional handles the previous delta=0.0 case
|
//Only change zoom level if we've accumulated +/- 1.0 of deltas. This conditional handles the previous delta=0.0 case
|
||||||
if (abs(scrollAccum) < 1.0) {
|
if (std::fabs(scrollAccum) < 1.0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user