From 70fcf6897954d63674c6467e88175cddc4b32645 Mon Sep 17 00:00:00 2001 From: fourinone41 Date: Thu, 11 Jul 2024 07:03:53 -0400 Subject: [PATCH] screenshot compatible with dark theme extension --- js/simulator-ui/ui-main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/simulator-ui/ui-main.js b/js/simulator-ui/ui-main.js index c8fb3ac0..20ff877f 100644 --- a/js/simulator-ui/ui-main.js +++ b/js/simulator-ui/ui-main.js @@ -620,6 +620,7 @@ ${t('results.buckets')}: ${this.results.bucketSunk}`; setTimeout(() => n == this.showNoticeCount && (this.showNoticeCount = 0), 1000); }, onclickScreenShot: function() { + this.$refs.divResults.style.backgroundColor = window.getComputedStyle(document.body).backgroundColor; html2canvas(this.$refs.divResults).then(canvas => { canvas.toBlob(blob => navigator.clipboard.write([new ClipboardItem({ 'image/png':blob })])); this.noticeTxt = this.$i18n.t('copied_to_clipboard'); @@ -634,6 +635,7 @@ ${t('results.buckets')}: ${this.results.bucketSunk}`; a.click(); document.body.removeChild(a); }); + this.$refs.divResults.style.backgroundColor = ''; }, onclickDeckbuilder: function() {