Revert "tdf#142832: a blind fix - calculate rectangle size properly"

This reverts commit 57d1222584.

Reason for revert:
As mentioned in https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowrect,

> In conformance with conventions for the RECT structure, the bottom-
> right coordinates of the returned rectangle are exclusive. In other
> words, the pixel at (right, bottom) lies immediately outside the
> rectangle.

So it was incorrect change.

Change-Id: I2b29871a5d9b944ce2f9119edb2e87c53d9ae298
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117212
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2021-06-14 21:48:37 +02:00
parent b3bf90ec5f
commit 3c472ffe90

View file

@ -65,8 +65,10 @@ bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_I
if( it != m_aDeviceNameToMonitor.end() ) if( it != m_aDeviceNameToMonitor.end() )
{ {
DisplayMonitor& rMon( m_aMonitors[ it->second ] ); DisplayMonitor& rMon( m_aMonitors[ it->second ] );
rMon.m_aArea = tools::Rectangle(aInfo.rcMonitor.left, aInfo.rcMonitor.top, rMon.m_aArea = tools::Rectangle( Point( aInfo.rcMonitor.left,
aInfo.rcMonitor.right, aInfo.rcMonitor.bottom); aInfo.rcMonitor.top ),
Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left,
aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) );
if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 ) if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 )
m_nPrimary = it->second; m_nPrimary = it->second;
} }