Skip to content

Commit 282d8b0

Browse files
Normalize arbitrary int to 0...1 float (#962)
1 parent ec48485 commit 282d8b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/src/main/java/com/genexus/reports/PDFReportPDFBox.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ public void GxDrawRect(int left, int top, int right, int bottom, int pen, int fo
242242

243243
if (cornerRadioBL == 0 && cornerRadioBR == 0 && cornerRadioTL == 0 && cornerRadioTR == 0 && styleBottom == 0 && styleLeft == 0 && styleRight == 0 && styleTop == 0) {
244244
if (pen > 0)
245-
cb.setStrokingColor(foreRed, foreGreen, foreBlue);
245+
cb.setStrokingColor(foreRed / 255f, foreGreen / 255f, foreBlue / 255f);
246246
else
247-
cb.setStrokingColor(backRed, backGreen, backBlue);
247+
cb.setStrokingColor(backRed / 255f, backGreen / 255f, backBlue / 255f);
248248

249249
cb.addRect(x1, y1, x2 - x1, y2 - y1);
250250

@@ -278,7 +278,7 @@ public void GxDrawRect(int left, int top, int right, int bottom, int pen, int fo
278278
cRadioBR = Math.max(0, Math.min(cRadioBR, max / 2));
279279

280280
if (backMode != 0) {
281-
cb.setStrokingColor(backRed, backGreen, backBlue);
281+
cb.setStrokingColor(backRed / 255f, backGreen / 255f, backBlue / 255f);
282282
cb.setLineWidth(0);
283283
roundRectangle(cb, x1, y1, w, h,
284284
cRadioTL, cRadioTR,
@@ -288,7 +288,7 @@ public void GxDrawRect(int left, int top, int right, int bottom, int pen, int fo
288288
cb.setLineWidth(penAux);
289289
}
290290
if (pen > 0) {
291-
cb.setStrokingColor(foreRed, foreGreen, foreBlue);
291+
cb.setStrokingColor(foreRed / 255f, foreGreen / 255f, foreBlue / 255f);
292292
drawRectangle(cb, x1, y1, w, h,
293293
styleTop, styleBottom, styleRight, styleLeft,
294294
cRadioTL, cRadioTR,
@@ -322,7 +322,7 @@ public void GxDrawLine(int left, int top, int right, int bottom, int width, int
322322
y2 = pageSize.getUpperRightY() - topAux - topMargin -bottomMargin;
323323

324324
cb.saveGraphicsState();
325-
cb.setStrokingColor(foreRed, foreGreen, foreBlue);
325+
cb.setStrokingColor(foreRed / 255f, foreGreen / 255f, foreBlue / 255f);
326326
cb.setLineWidth(widthAux);
327327

328328
if (lineCapProjectingSquare) {

0 commit comments

Comments
 (0)