aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-08-24 14:28:13 -0400
committerbobzel <zzzman@gmail.com>2021-08-24 14:28:13 -0400
commit5867ca16f8a8beaf7daf754ee5c42a5cc249346f (patch)
treed59c42afdbc9f0aa0abc8b8e79772df5c639f4ab /src/fields/Doc.ts
parenta38501569769c00dc1c25fb57d09ca88f3951c3d (diff)
fixed undo for dragging docs. made separate layers for transparent and other annotations on pdfs/webs so that transparency will work better.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index e4087cf43..f6efefdf9 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -25,6 +25,7 @@ import { deleteProperty, GetEffectiveAcl, getField, getter, inheritParentAcls, m
import JSZip = require("jszip");
import { CurrentUserUtils } from "../client/util/CurrentUserUtils";
import { IconProp } from "@fortawesome/fontawesome-svg-core";
+import Color = require("color");
export namespace Field {
export function toKeyValueString(doc: Doc, key: string): string {
@@ -1087,6 +1088,10 @@ export namespace Doc {
}
export function matchFieldValue(doc: Doc, key: string, value: any): boolean {
+ if (value === "isTransparent(__value__)") {
+ const isTransparent = (color: string) => color !== "" && (Color(color).alpha() !== 1);
+ return isTransparent(StrCast(doc[key]));
+ }
const fieldVal = doc[key];
if (Cast(fieldVal, listSpec("string"), []).length) {
const vals = Cast(fieldVal, listSpec("string"), []);