Skip to content

[Bug]: maximum size isn't respected correctly when aspect ratio is enabled #29100

Closed

Description

@CezaryKulakowski

Preflight Checklist

Electron Version

14.0.0-nightly.20210507

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

don't know

Steps to reproduce

  1. Launch following application:
const { app, BrowserWindow } = require('electron')

function startTest() {
  let win = new BrowserWindow({
    width: 200,
    height: 200,
    minWidth: 100,
    maxWidth: 300,
    minHeight: 100,
    maxHeight:300
  });
  win.webContents.loadURL('https://www.example.com');
  win.setAspectRatio(1.0);
}

app.on('ready', startTest)
  1. Resize window to maximum size.

Expected Behavior

Maximum size is correctly respected also when aspect ratio is enabled.

Actual Behavior

It's not possible to resize window to maximum size. Also aspect ratio is not respected (width != height). Additionally there is a DCHECK in Testing build:

[24772:0511/131301.276:FATAL:resize_utils.cc(44)] Check failed: Rect(rect->origin(), max_window_size).Contains(*rect). 860,420 256x250 is larger than the maximum size 284x241

Testcase Gist URL

No response

Additional Information

No response

Activity

  1. CezaryKulakowski commented on May 11, 2021

    @CezaryKulakowski
    ContributorAuthor

    I've created pr with fix for this issue: #29101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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