mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-02 12:27:21 +02:00
Merge pull request #21642 from Snuffleupagus/normalizeBlendMode-shorten
Reduce a tiny bit of duplication in the `normalizeBlendMode` helper
This commit is contained in:
commit
a03ec7e8c5
@ -140,12 +140,7 @@ function normalizeBlendMode(value, parsingArray = false) {
|
||||
return "source-over";
|
||||
}
|
||||
|
||||
if (!(value instanceof Name)) {
|
||||
if (parsingArray) {
|
||||
return null;
|
||||
}
|
||||
return "source-over";
|
||||
}
|
||||
if (value instanceof Name) {
|
||||
switch (value.name) {
|
||||
case "Normal":
|
||||
case "Compatible":
|
||||
@ -181,11 +176,9 @@ function normalizeBlendMode(value, parsingArray = false) {
|
||||
case "Luminosity":
|
||||
return "luminosity";
|
||||
}
|
||||
if (parsingArray) {
|
||||
return null;
|
||||
}
|
||||
warn(`Unsupported blend mode: ${value.name}`);
|
||||
return "source-over";
|
||||
}
|
||||
return parsingArray ? null : "source-over";
|
||||
}
|
||||
|
||||
function addCachedImageOps(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user