Skip to content

Add border stroke for TYPE_CROSS check fields #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dadza
Copy link
Contributor

@dadza dadza commented Jan 23, 2025

Fixes #1261

Description of the new Feature/Bugfix

Added a stroke() call for the rectangle used to draw the field border in getAppearanceRadioCross.

Related Issue: #1261

Thank you,
Lucian chirita

Copy link
Contributor

@mkl-public mkl-public left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect,

  • the rectangle must only be stroked if a solid stroke border is selected while you stroke unconditionally,
  • the clip call must be before the stroke call if any, and
  • the newPath call in case of the on state must be dropped if the rectangle is stroked.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@dadza dadza requested a review from mkl-public April 25, 2025 08:21
@dadza
Copy link
Contributor Author

dadza commented Apr 25, 2025

Reimplemented the fix by using the border appearance code from BaseField.getBorderAppearance() for TYPE_CROSS check fields.

Copy link
Contributor

@mkl-public mkl-public left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: I only reviewed the changes in the source code. I didn't find any blockers (which I had seen in my review of the first merge request), so I don't disapprove of this. But to really approve the CR, the reviewer should check result PDFs of applying this code to real world test inputs.

I do not see any real issue in the proposed change. Two observations, though:

  • The public static method RadioCheckField.getAppearanceRadioCross has been given an additional parameter. This strictly speaking is a break of the public API. One could argue, though, that this method will hardly be used directly by any code from outside the lib.
  • If I read the code change correctly, no clip path is applied to the on state appearance anymore to restrict the cross to the inside of the box. But as the cross is explicitly drawn by the code using the known box dimensions, this shouldn't be an issue. (Well, if someone used minute check boxes, e.g. with a width or height of 5 units or less, the cross might look weird, but that's no change to the state before).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Border of cross check field not visible in Chrome viewer
2 participants