From 5a305a6740263c3cd5997d09071e69825670affd Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Fri, 6 Apr 2018 03:05:06 +0200 Subject: [PATCH] Fix wrong screenshot size when browser zoom is not 100% --- Core/Notification/Screenshot/FormNotificationScreenshotable.cs | 2 +- Resources/Scripts/screenshot.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Notification/Screenshot/FormNotificationScreenshotable.cs b/Core/Notification/Screenshot/FormNotificationScreenshotable.cs index 2a4efab5..d86f2dcc 100644 --- a/Core/Notification/Screenshot/FormNotificationScreenshotable.cs +++ b/Core/Notification/Screenshot/FormNotificationScreenshotable.cs @@ -48,7 +48,7 @@ protected override string GetTweetHTML(TweetNotification tweet){ } private void SetScreenshotHeight(int height){ - SetNotificationSize(width, height); // TODO test how it works on high DPI, probably not great? + SetNotificationSize(width, height); } public void TakeScreenshot(){ diff --git a/Resources/Scripts/screenshot.js b/Resources/Scripts/screenshot.js index 65696805..9d6ea716 100644 --- a/Resources/Scripts/screenshot.js +++ b/Resources/Scripts/screenshot.js @@ -1,6 +1,6 @@ (function($TD){ let ele = document.getElementsByTagName("article")[0]; - ele.style.width = window.outerWidth+"px"; + ele.style.width = Math.floor(window.outerWidth/window.devicePixelRatio)+"px"; ele.style.position = "absolute"; let contentHeight = ele.offsetHeight;