mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-25 23:35:02 +08:00
fixed screenshot alignment
This commit is contained in:
parent
bf3ea69b6e
commit
f6d377225c
1 changed files with 4 additions and 4 deletions
|
@ -282,9 +282,9 @@ export async function screenshot(): Promise<void> {
|
|||
);
|
||||
}
|
||||
$(".pageTest .buttons").addClass("hidden");
|
||||
const src = $("#middle");
|
||||
const sourceX = src.position().left; /*X position from div#target*/
|
||||
const sourceY = src.position().top; /*Y position from div#target*/
|
||||
const src = $("#result");
|
||||
const sourceX = src.offset()?.left ?? 0; /*X position from div#target*/
|
||||
const sourceY = src.offset()?.top ?? 0; /*Y position from div#target*/
|
||||
const sourceWidth = <number>(
|
||||
src.outerWidth(true)
|
||||
); /*clientWidth/offsetWidth from div#target*/
|
||||
|
@ -301,7 +301,7 @@ export async function screenshot(): Promise<void> {
|
|||
if (revertCookie) $("#cookiePopupWrapper").addClass("hidden");
|
||||
try {
|
||||
const paddingX = 50;
|
||||
const paddingY = 25;
|
||||
const paddingY = 50;
|
||||
html2canvas(document.body, {
|
||||
backgroundColor: await ThemeColors.get("bg"),
|
||||
width: sourceWidth + paddingX * 2,
|
||||
|
|
Loading…
Reference in a new issue