The NFTSVG library has a visual assymetry issue.
If the total width of the cards combined is not an even number, dividing by two and truncating the result could lead to one side of the SVG having slightly more whitespace than the other. While often minor, in detailed graphical representations, especially those intended for high-resolution displays or where precise symmetry is aesthetically important, this could be noticeable.
The calculation (1000 - vars.cardsWidth) / 2
sets the starting position for the progress card based on the total width of all cards plus margins. This assumes an even distribution of remaining space on either side of the combined cards.
However, this approach can lead to a situation where the cardsWidth calculation results in an odd number, causing the / 2 division to round down.
The subsequent positioning of the status, amount, and duration cards builds off the initial progress card's position, propagating any initial misalignment throughout the layout.
Visual Misalignment: The cards may not be centered correctly within the SVG canvas, potentially resulting in an unbalanced visual appearance.
Manual Review
Check whether will truncate: ((1000 - vars.cardsWidth) / 2) % 2 == 1
, in case this condition is true add +1 before the division.
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.