This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new c60bfbc060 vcl: take only whole SAL_AQUA_BACKING_SCALE values from 1
to 4
c60bfbc060 is described below
commit c60bfbc060a01af3eab9e58ea07b1ecd178874bc
Author: Jim Jagielski <[email protected]>
AuthorDate: Mon Nov 16 12:52:34 2026 -0500
vcl: take only whole SAL_AQUA_BACKING_SCALE values from 1 to 4
CGLayer rounds a fractional pixel size up, so a scale like 1.5 broke
the XOR emulation and the virtual device size checks.
---
main/vcl/aqua/source/window/salframe.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/main/vcl/aqua/source/window/salframe.cxx
b/main/vcl/aqua/source/window/salframe.cxx
index 794524a8cd..b59fbd02e2 100644
--- a/main/vcl/aqua/source/window/salframe.cxx
+++ b/main/vcl/aqua/source/window/salframe.cxx
@@ -25,7 +25,6 @@
#include "precompiled_vcl.hxx"
#include <string>
-#include <cmath>
#include <cstdlib>
#include "rtl/ustrbuf.hxx"
@@ -260,16 +259,17 @@ void AquaSalFrame::VCLToCocoa( NSPoint& io_rPoint, bool
bRelativeToScreen )
// -----------------------------------------------------------------------
// SAL_AQUA_BACKING_SCALE=1 on a Retina screen (or =2 on a 1x one) tests the
other scale
+// whole numbers only: CGLayer rounds a fractional pixel size up
static float getBackingScaleOverride()
{
const char* pEnvStr = getenv( "SAL_AQUA_BACKING_SCALE" );
if( !pEnvStr )
return 0;
char* pEnd = NULL;
- const double fValue = strtod( pEnvStr, &pEnd );
- if( pEnd == pEnvStr || *pEnd || !std::isfinite( fValue ) || fValue <= 0 )
+ const long nValue = strtol( pEnvStr, &pEnd, 10 );
+ if( pEnd == pEnvStr || *pEnd || nValue < 1 || nValue > 4 )
return 0;
- return static_cast<float>(fValue);
+ return static_cast<float>(nValue);
}
bool AquaSalFrame::UpdateBackingScale()