1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-07 00:15:52 +02:00

Make it easier to debug screenshots

This commit is contained in:
chylex 2018-05-30 19:50:11 +02:00
parent 03730fafb9
commit 97f42ead66
3 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,7 @@ public FormNotificationScreenshotable(Action callback, FormBrowser owner, Plugin
}
using(IFrame frame = args.Browser.MainFrame){
ScriptLoader.ExecuteScript(frame, script.Replace("{width}", BrowserUtils.Scale(width, DpiScale).ToString()), "screenshot");
ScriptLoader.ExecuteScript(frame, script.Replace("{width}", BrowserUtils.Scale(width, DpiScale).ToString()).Replace("{frames}", TweetScreenshotManager.WaitFrames.ToString()), "gen:screenshot");
}
};

View File

@ -27,6 +27,10 @@ sealed class TweetScreenshotManager : IDisposable{
#if GEN_SCREENSHOT_FRAMES
private readonly Timer debugger;
private int frameCounter;
public const int WaitFrames = 60;
#else
public const int WaitFrames = 5;
#endif
private FormNotificationScreenshotable screenshot;

View File

@ -10,7 +10,7 @@
let avatarBottom = avatar ? avatar.getBoundingClientRect().bottom : 0;
$TD.setHeight(Math.floor(Math.max(contentHeight, avatarBottom+9))).then(() => {
let framesLeft = 5; // basic render is done in 1 frame, large media take longer
let framesLeft = {frames}; // basic render is done in 1 frame, large media take longer
let onNextFrame = function(){
if (--framesLeft < 0){