mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-30 02:47:22 +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";
|
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