Skip to content

Commit 808ad52

Browse files
guustysebieiText-CI
authored andcommitted
Improve checkbox rendering
DEVSIX-7443 Autoported commit. Original commit hash: [05be04ca9]
1 parent 394e8fd commit 808ad52

18 files changed

+9
-11
lines changed

itext/itext.html2pdf/itext/html2pdf/attach/impl/tags/InputTagWorker.cs

+8-10
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,14 @@ public InputTagWorker(IElementNode element, ProcessorContext context) {
117117
if (AttributeConstants.CHECKBOX.Equals(inputType)) {
118118
CheckBox cb = new CheckBox(name);
119119
String @checked = element.GetAttribute(AttributeConstants.CHECKED);
120-
if (ExperimentalFeatures.ENABLE_EXPERIMENTAL_CHECKBOX_RENDERING) {
121-
// so in the previous implementation the width was 8.25 and the borders .75,
122-
// but the borders got drawn on the outside of the box, so the actual size was 9.75
123-
// because 8.25 + 2 * .75 = 9.75
124-
float widthWithBordersOnTheInside = 9.75f;
125-
float defaultBorderWith = 0.75f;
126-
cb.SetSize(widthWithBordersOnTheInside);
127-
cb.SetBorder(new SolidBorder(ColorConstants.DARK_GRAY, defaultBorderWith));
128-
cb.SetBackgroundColor(ColorConstants.WHITE);
129-
}
120+
// so in the previous implementation the width was 8.25 and the borders .75,
121+
// but the borders got drawn on the outside of the box, so the actual size was 9.75
122+
// because 8.25 + 2 * .75 = 9.75
123+
float widthWithBordersOnTheInside = 9.75f;
124+
float defaultBorderWith = .75f;
125+
cb.SetSize(widthWithBordersOnTheInside);
126+
cb.SetBorder(new SolidBorder(ColorConstants.DARK_GRAY, defaultBorderWith));
127+
cb.SetBackgroundColor(ColorConstants.WHITE);
130128
// has attribute == is checked
131129
cb.SetChecked(@checked != null);
132130
formElement = cb;

port-hash

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9abdfe41eb72b7026187f2c708d629937f2e2f8e
1+
05be04ca906a2329e95da533b83efd62d81368ec

0 commit comments

Comments
 (0)