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
In the Fiddle Gist, setContentBounds({ x: 10, y: 10, width: 400, height: 300 }) should set the contents as 400x300 originating from (10, 10) within the 800x600 window, whereas it converts the BrowserWindow to 400x300 that originates from (10, 10) of the screen.
Same goes for setContentSize
The text was updated successfully, but these errors were encountered:
This unfortunately has never worked as you expect - we should probably reclassify this as a feature request or otherwise decide what to do with those functions.
@brondibur following up on this - it was never intended to work that way. It resizes the window bounds according to then content area, but it never resized content without affecting window bounds at all. You can use webContentsView to do what you want.
Preflight Checklist
Electron Version
30.0.4
What operating system are you using?
macOS
Operating System Version
macOS Sonoma 14.4.1
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
setContentBounds
/setContentSize
resize the contents relative to the window.Actual Behavior
setContentBounds
/setContentSize
actually behave likesetBounds
and set the bounds of the entire window instead of the contents within it.Testcase Gist URL
https://gist.github.com/brondibur/f063baec603e95a206a3e69afafd32a1
Additional Information
In the Fiddle Gist,
setContentBounds({ x: 10, y: 10, width: 400, height: 300 })
should set the contents as 400x300 originating from (10, 10) within the 800x600 window, whereas it converts the BrowserWindow to 400x300 that originates from (10, 10) of the screen.Same goes for
setContentSize
The text was updated successfully, but these errors were encountered: