feat: implement win.setAspectRatio() on Linux (#19516)
This commit is contained in:
parent
4240017cb6
commit
dcf6f046d9
5 changed files with 45 additions and 2 deletions
|
@ -709,6 +709,18 @@ bool NativeWindowViews::IsResizable() {
|
|||
return CanResize();
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetAspectRatio(double aspect_ratio,
|
||||
const gfx::Size& extra_size) {
|
||||
NativeWindow::SetAspectRatio(aspect_ratio, extra_size);
|
||||
#if defined(OS_LINUX)
|
||||
gfx::SizeF aspect(aspect_ratio, 1.0);
|
||||
// Scale up because SetAspectRatio() truncates aspect value to int
|
||||
aspect.Scale(100);
|
||||
|
||||
widget()->SetAspectRatio(aspect);
|
||||
#endif
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetMovable(bool movable) {
|
||||
movable_ = movable;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue