1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Remove pointless Math.min usage in the XFA parsing

When creating the `StyleMapping` for the "xfa-font-horizontal-scale" and "xfa-font-vertical-scale" properties there's currently pointless `Math.min` usage, since we're not actually comparing with anything.
This commit is contained in:
Jonas Jenwald 2025-03-08 12:22:33 +01:00
parent bee0f53c65
commit 1b5151f969

View file

@ -81,13 +81,11 @@ const StyleMapping = new Map([
["kerning-mode", value => (value === "none" ? "none" : "normal")],
[
"xfa-font-horizontal-scale",
value =>
`scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`,
value => `scaleX(${Math.max(0, parseInt(value) / 100).toFixed(2)})`,
],
[
"xfa-font-vertical-scale",
value =>
`scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`,
value => `scaleY(${Math.max(0, parseInt(value) / 100).toFixed(2)})`,
],
["xfa-spacerun", ""],
["xfa-tab-stops", ""],