Skip to content

BrowserWindow.setBounds() typeError #9552

@brianfajardo

Description

@brianfajardo
  • Electron version: 1.6.8
  • Operating system: Windows 10

Expected behavior

When passing in a configuration object {x, y, height, width} to setBounds() I expected BrowserWindow to conform to the given number type dimensions.

Actual behavior

electron-error

Temporary Fix

When I logged my boundsConfig , terminal displayed:

{ x: 1621.5, y: 611, height: 501, width: 301 }

Every value is a number, however, the value of x was a floating point. I tried Math.round(x) , Math.floor(x) , Math.ceil(x) and that seemed to solve the problem. I also tried adding a literal value of 0.5 to the other variables and the same error was reproduced. Appears that setBounds() does not take floating points.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions