RED-6204: Removed redundant variable assignment (sonar issue) & simplified code
This commit is contained in:
parent
8ed976b0f7
commit
3804acf3c1
@ -25,16 +25,13 @@ public final class RulingTextDirAdjustUtil {
|
|||||||
private Point2D convertPoint(float x, float y, float dir, float pageWidth, float pageHeight) {
|
private Point2D convertPoint(float x, float y, float dir, float pageWidth, float pageHeight) {
|
||||||
|
|
||||||
var xAdj = getXRot(x, y, dir, pageWidth, pageHeight);
|
var xAdj = getXRot(x, y, dir, pageWidth, pageHeight);
|
||||||
var yAdj = 0f;
|
var yLowerLeftRot = getYLowerLeftRot(x, y, dir, pageWidth, pageHeight);
|
||||||
if (dir == 0 || dir == 180) {
|
var yAdj = (dir == 0 || dir == 180) ? pageHeight - yLowerLeftRot : pageWidth - yLowerLeftRot;
|
||||||
yAdj = pageHeight - getYLowerLeftRot(x, y, dir, pageWidth, pageHeight);
|
|
||||||
} else {
|
|
||||||
yAdj = pageWidth - getYLowerLeftRot(x, y, dir, pageWidth, pageHeight);
|
|
||||||
}
|
|
||||||
return new Point2D.Float(xAdj, yAdj);
|
return new Point2D.Float(xAdj, yAdj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("SuspiciousNameCombination")
|
||||||
private float getXRot(float x, float y, float dir, float pageWidth, float pageHeight) {
|
private float getXRot(float x, float y, float dir, float pageWidth, float pageHeight) {
|
||||||
|
|
||||||
if (dir == 0) {
|
if (dir == 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user