Fixed zooming bug in native-host-ext [Chrome] (#1936)

Co-authored-by: alazymeme <jkeasley@icloud.com>
Co-authored-by: 23rd <23rd@vivaldi.net>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Matthew Marlow
2021-07-25 08:13:21 -05:00
committed by GitHub
parent 700e092bf6
commit 6052a0ede6
4 changed files with 27 additions and 8 deletions
+11 -1
View File
@@ -93,6 +93,7 @@ AttachedWindow *AttachedWindow::get(void *target, const GetArgs &args)
window->fullscreen_ = args.fullscreen;
window->x_ = args.x;
window->pixelRatio_ = args.pixelRatio;
if (args.height != -1)
{
@@ -276,7 +277,16 @@ void AttachedWindow::updateWindowRect(void *_attachedPtr)
// offset
int o = this->fullscreen_ ? 0 : 8;
if (this->x_ != -1)
if (this->pixelRatio_ != -1.0)
{
::MoveWindow(
hwnd,
int(rect.left + this->x_ * scale * this->pixelRatio_ + o - 2),
int(rect.bottom - this->height_ * scale - o),
int(this->width_ * scale), int(this->height_ * scale), true);
}
//support for old extension version 1.3
else if (this->x_ != -1.0)
{
::MoveWindow(hwnd, int(rect.left + this->x_ * scale + o),
int(rect.bottom - this->height_ * scale - o),