libs/dimg/filters/transform/shearfilter.cpp
(Diff revision 1)
|
void ShearFilter::filterImage() |
123 |
horz_add = nHeight * ((d->hAngle < 0.0) ? sin(horz_beta_angle) : cos(horz_beta_angle)); |
123 |
horz_add = fabs(nHeight * ((d->hAngle < 0.0) ? sin(horz_beta_angle) : cos(horz_beta_angle))); |
124 |
vert_add = nWidth * ((d->vAngle < 0.0) ? sin(vert_beta_angle) : cos(vert_beta_angle)); |
124 |
vert_add = fabs(nWidth * ((d->vAngle < 0.0) ? sin(vert_beta_angle) : cos(vert_beta_angle))); |
125 |
|
|
|
126 |
// get absolute values for the distances |
|
|
127 |
horz_add = fabs(horz_add); |
|
|
128 |
vert_add = fabs(vert_add); |
|
|
Fwiw, the original code is easier to read to me...you should also merge the comments
libs/dimg/filters/transform/shearfilter.cpp
(Diff revision 1)
|
void ShearFilter::filterImage() |
180 |
nx = x + dx + y * horz_factor; |
176 |
nx = fabs(x + dx + y * horz_factor); |
181 |
ny = y + dy + x * vert_factor; |
177 |
ny = fabs(y + dy + x * vert_factor); |
I don't see a way this could be negative...? Iow, why the fabs here?
- Martin Klapetek
On February 4th, 2014, 9:10 p.m. CET, Heena Mahour wrote:
Review request for Digikam.
By Heena Mahour.
Updated Feb. 4, 2014, 9:10 p.m.
Repository:
digikam
Description
-Removed the trailing spaces
-Removed redundant code
-Required absolute value so used fabs()
|
Testing
Diffs
- libs/dimg/filters/transform/shearfilter.cpp (96a4534)
View Diff
|
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel