aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-07-26 13:02:00 -0400
committerbobzel <zzzman@gmail.com>2023-07-26 13:02:00 -0400
commit48db0d060c53f4051df9b5c081334a8b82bb0a22 (patch)
tree1178f449e83470f0747f09bc0bb4d5f6f9b6e3a2 /src/Utils.ts
parentc87024c06941920f1df689d54d82cc309891e3d2 (diff)
fixed drawing on pdfs. fixed corsproxy issues on webpages (eg, bing search), fixed contextmenu color and dockedbtn color,
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index e03632c8b..599c6456a 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -16,18 +16,18 @@ export namespace Utils {
return Date.now() - downTime < Utils.CLICK_TIME && Math.abs(x - downX) < Utils.DRAG_THRESHOLD && Math.abs(y - downY) < Utils.DRAG_THRESHOLD;
}
- export function cleanDocumentType(type: DocumentType) {
- switch(type) {
+ export function cleanDocumentType(type: DocumentType) {
+ switch (type) {
case DocumentType.IMG:
- return "Image"
+ return 'Image';
case DocumentType.AUDIO:
- return "Audio"
+ return 'Audio';
case DocumentType.COL:
- return "Collection"
+ return 'Collection';
case DocumentType.RTF:
- return "Text"
- default:
- return type.charAt(0).toUpperCase() + type.slice(1)
+ return 'Text';
+ default:
+ return type.charAt(0).toUpperCase() + type.slice(1);
}
}
@@ -140,7 +140,7 @@ export namespace Utils {
}
export function colorString(color: ColorState) {
- return color.hex.startsWith('#') ? color.hex + (color.rgb.a ? decimalToHexString(Math.round(color.rgb.a * 255)) : 'ff') : color.hex;
+ return color.hex.startsWith('#') && color.hex.length < 8 ? color.hex + (color.rgb.a ? decimalToHexString(Math.round(color.rgb.a * 255)) : 'ff') : color.hex;
}
export function fromRGBAstr(rgba: string) {