2023-06-14 10:20:02 +02:00
|
|
|
diff --git ui/display/screen.cc ui/display/screen.cc
|
2023-12-06 21:16:15 +01:00
|
|
|
index 22747ebcf31c0..8fba5da85a656 100644
|
2023-06-14 10:20:02 +02:00
|
|
|
--- ui/display/screen.cc
|
|
|
|
+++ ui/display/screen.cc
|
|
|
|
@@ -107,13 +107,13 @@ base::TimeDelta Screen::CalculateIdleTime() const {
|
|
|
|
gfx::Rect Screen::ScreenToDIPRectInWindow(gfx::NativeWindow window,
|
|
|
|
const gfx::Rect& screen_rect) const {
|
|
|
|
float scale = GetDisplayNearestWindow(window).device_scale_factor();
|
|
|
|
- return ScaleToEnclosingRect(screen_rect, 1.0f / scale);
|
|
|
|
+ return ScaleToEnclosedRect(screen_rect, 1.0f / scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Rect Screen::DIPToScreenRectInWindow(gfx::NativeWindow window,
|
|
|
|
const gfx::Rect& dip_rect) const {
|
|
|
|
float scale = GetDisplayNearestWindow(window).device_scale_factor();
|
|
|
|
- return ScaleToEnclosingRect(dip_rect, scale);
|
|
|
|
+ return ScaleToEnclosedRect(dip_rect, scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Screen::GetDisplayWithDisplayId(int64_t display_id,
|
|
|
|
diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc
|
2024-04-23 22:06:00 +02:00
|
|
|
index 3a9a310328aa3..d4c4a9947c1d9 100644
|
2023-06-14 10:20:02 +02:00
|
|
|
--- ui/display/win/screen_win.cc
|
|
|
|
+++ ui/display/win/screen_win.cc
|
2024-04-23 22:06:00 +02:00
|
|
|
@@ -544,7 +544,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) {
|
2023-06-14 10:20:02 +02:00
|
|
|
gfx::PointF(pixel_bounds.origin()), screen_win_display));
|
|
|
|
const float scale_factor =
|
|
|
|
1.0f / screen_win_display.display().device_scale_factor();
|
|
|
|
- return {origin, ScaleToEnclosingRect(pixel_bounds, scale_factor).size()};
|
|
|
|
+ return {origin, ScaleToEnclosedRect(pixel_bounds, scale_factor).size()};
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2024-04-23 22:06:00 +02:00
|
|
|
@@ -559,7 +559,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) {
|
2023-06-14 10:20:02 +02:00
|
|
|
const gfx::Point origin =
|
|
|
|
display::win::DIPToScreenPoint(dip_bounds.origin(), screen_win_display);
|
|
|
|
const float scale_factor = screen_win_display.display().device_scale_factor();
|
|
|
|
- return {origin, ScaleToEnclosingRect(dip_bounds, scale_factor).size()};
|
|
|
|
+ return {origin, ScaleToEnclosedRect(dip_bounds, scale_factor).size()};
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|