mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-30 19:07:22 +02:00
Reduce a tiny bit of duplication in the normalizeBlendMode helper
This commit is contained in:
parent
2ea8820d92
commit
63a0f285b8
@ -140,12 +140,7 @@ function normalizeBlendMode(value, parsingArray = false) {
|
|||||||
return "source-over";
|
return "source-over";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(value instanceof Name)) {
|
if (value instanceof Name) {
|
||||||
if (parsingArray) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return "source-over";
|
|
||||||
}
|
|
||||||
switch (value.name) {
|
switch (value.name) {
|
||||||
case "Normal":
|
case "Normal":
|
||||||
case "Compatible":
|
case "Compatible":
|
||||||
@ -181,11 +176,9 @@ function normalizeBlendMode(value, parsingArray = false) {
|
|||||||
case "Luminosity":
|
case "Luminosity":
|
||||||
return "luminosity";
|
return "luminosity";
|
||||||
}
|
}
|
||||||
if (parsingArray) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
warn(`Unsupported blend mode: ${value.name}`);
|
warn(`Unsupported blend mode: ${value.name}`);
|
||||||
return "source-over";
|
}
|
||||||
|
return parsingArray ? null : "source-over";
|
||||||
}
|
}
|
||||||
|
|
||||||
function addCachedImageOps(
|
function addCachedImageOps(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user