You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Short and long screenshots have different widths despite setDeviceMetricsOverride #84
Both snapshots should be 1920 pixels wide, but snap_short.png (for whatever reason - not the longer one!) comes out 1890 pixels wide. [Update: The shorter 404 one's dimenions are due to the HTML element having a 15-pixel-wide padding on both sides, which is not included in screenshots, and can be fixed by passing region="padding" to b$screenshot. See below for an updated example.]
I thought I had a solution for this while working on other issues (involving 05586e3 and/or b$Emulation$setScrollbarsHidden(TRUE) near b$Emulation$setDeviceMetricsOverride, but I cannot currently reproduce that. (see below)
This snapshot comes out at width 1905 and may be the closest case to rstudio/shinytest2#171, and it is the case which is actually fixed by b$Emulation$setScrollbarsHidden(TRUE), somewhat regardless of where one puts it.
This snapshot is 1920 pixels wide, as expected. Interestingly, screenshot() does call setScrollbarsHidden already, but that call seems to be ineffective for some reason:
Activity
bersbersbers commentedon Apr 6, 2022
This is what I was looking for:
This snapshot comes out at width 1905 and may be the closest case to rstudio/shinytest2#171, and it is the case which is actually fixed by
b$Emulation$setScrollbarsHidden(TRUE), somewhat regardless of where one puts it.This snapshot is 1920 pixels wide, as expected. Interestingly,
screenshot()does callsetScrollbarsHiddenalready, but that call seems to be ineffective for some reason:chromote/R/screenshot.R
Line 52 in 865e24e
hadley commentedon Jan 30, 2024
Closing, since it seems like you figured out a solution.