Group: Forum Members
Posts: 45,
Visits: 235
|
I thought the size attribute as a percentage was a percentage of the display size but this does not seem to be the case, at least for the Y axis, when the screen is not at a 1920 x 1080 resolution.
I made a rectangle that was size = (50%, 50%) and position (50%, 50%). Therefore, as far as I understand, the four corners of the rectangle should be A(25%, 25%), B(75%, 25%), C(25%, 75%), D(75%, 75%). When my screen resolution was 1920 x 1080, this seems to be correct. The pixel coordinates for these positions were A(480, 270), B(1440, 270), C(480, 810), D(1440, 810).
However, when my screen resolution was 1280 x 1024, the pixel coordinates for the four corners were A(320, 330), B(960, 330), C(320, 690), D(960, 690), which in percentages, equates to A(25%, 32%), B(75%, 32%), C(25%, 67%), D(75%, 67%). So this suggests the size of the rectangle is actually (50%, 35%).
In another example, I used the resolution 1440 x 900, and the pixel coordinates for the four corners were: (A(360, 250), B(1080, 250), C(360, 650), D(1080, 650), which in percentages, equates to A(25%, 27%), B(75%, 27%), C(25%, 72%), D(75%, 72%). So this suggests the size of the rectangle is actually (50%, 45%).
It looks like size on the X axis is correctly scaled to the display width, but the size on the Y axis is not scaled to the display height.
Can anyone help me to understand this? Thanks
|