Skip to content

Commit 05be04c

Browse files
committed
Improve checkbox rendering
DEVSIX-7443
1 parent 9abdfe4 commit 05be04c

17 files changed

+8
-11
lines changed

src/main/java/com/itextpdf/html2pdf/attach/impl/tags/InputTagWorker.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ This file is part of the iText (R) project.
2222
*/
2323
package com.itextpdf.html2pdf.attach.impl.tags;
2424

25-
import com.itextpdf.commons.utils.ExperimentalFeatures;
2625
import com.itextpdf.commons.utils.MessageFormatUtil;
2726
import com.itextpdf.forms.form.FormProperty;
2827
import com.itextpdf.forms.form.element.Button;
@@ -122,16 +121,14 @@ public InputTagWorker(IElementNode element, ProcessorContext context) {
122121
} else if (AttributeConstants.CHECKBOX.equals(inputType)) {
123122
CheckBox cb = new CheckBox(name);
124123
String checked = element.getAttribute(AttributeConstants.CHECKED);
125-
if (ExperimentalFeatures.ENABLE_EXPERIMENTAL_CHECKBOX_RENDERING) {
126-
// so in the previous implementation the width was 8.25 and the borders .75,
127-
// but the borders got drawn on the outside of the box, so the actual size was 9.75
128-
// because 8.25 + 2 * .75 = 9.75
129-
final float widthWithBordersOnTheInside = 9.75f;
130-
final float defaultBorderWith = 0.75f;
131-
cb.setSize(widthWithBordersOnTheInside);
132-
cb.setBorder(new SolidBorder(ColorConstants.DARK_GRAY, defaultBorderWith));
133-
cb.setBackgroundColor(ColorConstants.WHITE);
134-
}
124+
// so in the previous implementation the width was 8.25 and the borders .75,
125+
// but the borders got drawn on the outside of the box, so the actual size was 9.75
126+
// because 8.25 + 2 * .75 = 9.75
127+
final float widthWithBordersOnTheInside = 9.75f;
128+
final float defaultBorderWith = .75f;
129+
cb.setSize(widthWithBordersOnTheInside);
130+
cb.setBorder(new SolidBorder(ColorConstants.DARK_GRAY, defaultBorderWith));
131+
cb.setBackgroundColor(ColorConstants.WHITE);
135132
// has attribute == is checked
136133
cb.setChecked(checked != null);
137134
formElement = cb;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)