Merge with ef386222219c7d420954431bdbcf252e8a487d1c

This commit is contained in:
Hombre
2014-02-19 14:09:22 +01:00
parent 8d70ca0f41
commit ee040bc8cd
94 changed files with 1433 additions and 218 deletions

View File

@@ -497,32 +497,34 @@ void Crop::vFlipCrop () {
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
}
void Crop::rotateCrop (int deg) {
int tmp;
switch ((360+deg-lastRotationDeg)%360) {
case 90:
tmp = nx;
nx = maxh - ny - nh;
ny = tmp;
tmp = nw;
nw = nh;
nh = tmp;
break;
case 270:
tmp = ny;
ny = maxw - nx - nw;
nx = tmp;
tmp = nw;
nw = nh;
nh = tmp;
break;
case 180:
nx = maxw - nx - nw;
ny = maxh - ny - nh;
break;
}
void Crop::rotateCrop (int deg, bool hflip, bool vflip) {
int rotation = (360+deg-lastRotationDeg)%360;
if((hflip != vflip) && ((rotation%180)==90))
rotation = (rotation + 180)%360;
int tmp;
switch (rotation) {
case 90:
tmp = nx;
nx = maxh - ny - nh;
ny = tmp;
tmp = nw;
nw = nh;
nh = tmp;
break;
case 270:
tmp = ny;
ny = maxw - nx - nw;
nx = tmp;
tmp = nw;
nw = nh;
nh = tmp;
break;
case 180:
nx = maxw - nx - nw;
ny = maxh - ny - nh;
break;
}
lastRotationDeg = deg;
g_idle_add (refreshSpinsUI, new RefreshSpinHelper (this, false));
}