unicenta-pos icon indicating copy to clipboard operation
unicenta-pos copied to clipboard

Potential fix for code scanning alert no. 1: Implicit narrowing conversion in compound assignment

Open poolborges opened this issue 11 months ago • 0 comments

Potential fix for https://github.com/poolborges/unicenta-pos/security/code-scanning/1

To fix the problem, we need to ensure that the type of the left-hand side of the compound assignment is at least as wide as the type of the right-hand side. In this case, we should change the type of left from float to double to match the type returned by getWidth(). This will prevent any implicit narrowing conversion and preserve the precision of the calculation.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

poolborges avatar Feb 19 '25 08:02 poolborges