mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-10 00:15:51 +02:00
Make it easier to debug screenshots
This commit is contained in:
parent
03730fafb9
commit
97f42ead66
Core/Notification/Screenshot
Resources/Scripts
@ -35,7 +35,7 @@ public FormNotificationScreenshotable(Action callback, FormBrowser owner, Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
using(IFrame frame = args.Browser.MainFrame){
|
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");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,6 +27,10 @@ sealed class TweetScreenshotManager : IDisposable{
|
|||||||
#if GEN_SCREENSHOT_FRAMES
|
#if GEN_SCREENSHOT_FRAMES
|
||||||
private readonly Timer debugger;
|
private readonly Timer debugger;
|
||||||
private int frameCounter;
|
private int frameCounter;
|
||||||
|
|
||||||
|
public const int WaitFrames = 60;
|
||||||
|
#else
|
||||||
|
public const int WaitFrames = 5;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private FormNotificationScreenshotable screenshot;
|
private FormNotificationScreenshotable screenshot;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
let avatarBottom = avatar ? avatar.getBoundingClientRect().bottom : 0;
|
let avatarBottom = avatar ? avatar.getBoundingClientRect().bottom : 0;
|
||||||
|
|
||||||
$TD.setHeight(Math.floor(Math.max(contentHeight, avatarBottom+9))).then(() => {
|
$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(){
|
let onNextFrame = function(){
|
||||||
if (--framesLeft < 0){
|
if (--framesLeft < 0){
|
||||||
|
Loading…
Reference in New Issue
Block a user