Merge branch 'dev' into hidpi-icons

This commit is contained in:
Hombre
2018-10-25 20:43:41 +02:00
216 changed files with 2636 additions and 1327 deletions

View File

@@ -267,15 +267,22 @@ void CropWindow::flawnOver (bool isFlawnOver)
this->isFlawnOver = isFlawnOver;
}
void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y)
void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, double deltaX, double deltaY)
{
double delta = 0.0;
if (abs(deltaX) > abs(deltaY)) {
delta = deltaX;
} else {
delta = deltaY;
}
bool isUp = direction == GDK_SCROLL_UP || (direction == GDK_SCROLL_SMOOTH && delta < 0.0);
if ((state & GDK_CONTROL_MASK) && onArea(ColorPicker, x, y)) {
// resizing a color picker
if (direction == GDK_SCROLL_UP) {
if (isUp) {
hoveredPicker->incSize();
updateHoveredPicker();
iarea->redraw ();
}else if (direction == GDK_SCROLL_DOWN) {
} else {
hoveredPicker->decSize();
updateHoveredPicker();
iarea->redraw ();
@@ -287,9 +294,9 @@ void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y)
screenCoordToImage(newCenterX, newCenterY, newCenterX, newCenterY);
if (direction == GDK_SCROLL_UP && !isMaxZoom()) {
if (isUp && !isMaxZoom()) {
zoomIn (true, newCenterX, newCenterY);
} else if (direction == GDK_SCROLL_DOWN && !isMinZoom()) {
} else if (!isUp && !isMinZoom()) {
zoomOut (true, newCenterX, newCenterY);
}
}