platformWidth
Kevin Rushforth
kevin.rushforth at oracle.com
Thu Jun 3 22:03:18 UTC 2021
The platformWidth / platformHeight can also be different from the width
/ height on Linux with Hi-DPI scaling, at least in theory, since the
Screen constructor is called using different parameters for the platform
values. Mac is different because of how the retina scaling is handled on
macOS -- even on a retina display, platformWidth/platformHeight ==
width/height and platformScale{X,Y} == 1.
-- Kevin
On 6/3/2021 2:38 PM, John Hendrikx wrote:
> Perhaps an example will help from my machine.
>
> I'm running on a 4k screen at 150% scaling. These are the values:
>
> outputScaleX = 1.5
> outputScaleY = 1.5
> platformScaleX = 1.5
> platformScaleY = 1.5
> width = 2560
> height = 1440
> visibleWidth = 2560
> visibleHeight = 1400
> platformWidth = 3840
> platformHeight = 2160
>
> So it seems that platform values report the actual resolution of the
> Screen / Monitor. Probably they're what is being reported by Windows
> and stored there by JavaFX to derive the actual width/height it should
> use while taking scaling into account.
>
> You didn't ask about the difference between visibleHeight and height.
> But just incase, the visibleHeight is 40 pixels smaller than height,
> as this space is taken up by the task bar.
>
> --John
>
>
> On 01/06/2021 13:27, Johan Vos wrote:
>> Hi,
>>
>> com.sun.glass.ui.Screen has 3 width (and height) parameters, each with a
>> getter:
>> * width
>> * visibleWidth
>> * platformWidth
>>
>> The latter seems to be used only in the windows build,
>> via screen.containsPlatformRect and screen.portionIntersectsPlatformRect
>>
>> I don't really understand what the goal of this platformWidth/Height
>> is. It
>> seems a bit artificial if this is not used on the other platforms, but I
>> might be missing the bigger purpose of this?
>>
>> - Johan
>>
More information about the openjfx-dev
mailing list