Skip to content

Commit 1c87a2b

Browse files
committed
fix automatic resize of electorn display before screenshot
1 parent c536067 commit 1c87a2b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

NetworkDynamicsInspector/src/serving.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,8 @@ function _resize_electron_to_content()
172172
"""
173173
y = run(window, js_max_h)
174174

175-
run(get_electron_app(), """
176-
{
177-
let win = BrowserWindow.fromId($(window.id))
178-
win.setSize(win.getSize()[0], $y)
179-
}
180-
""")
175+
oldres = CURRENT_DISPLAY[].resolution
176+
resolution = (oldres[1], y)
177+
CURRENT_DISPLAY[] = ElectronDisp(; resolution)
178+
get_electron_window() # trigger resize
181179
end

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using Electron
1212

1313

1414
@info "Create global electron window"
15-
NDI.CURRENT_DISPLAY[] = ElectronDisp(resolution=(1200,1020)) # hide
15+
NDI.CURRENT_DISPLAY[] = ElectronDisp(resolution=(1200,800)) # hide
1616
NDI.get_electron_window()
1717

1818
links = InterLinks(

0 commit comments

Comments
 (0)