﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 16 Sep 2026 04:40:57 GMT</lastBuildDate><ttl>20</ttl><item><title>How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?</title><link>https://forums.millisecond.com/Topic29219.aspx</link><description>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.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;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%). &lt;br/&gt;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). &lt;br/&gt;&lt;br/&gt;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), &lt;br/&gt;which in percentages, equates to&amp;nbsp;A(25%, 32%), B(75%, 32%), C(25%, 67%), D(75%, 67%). So this suggests the size of the rectangle is actually (50%, 35%).&amp;nbsp;&lt;br/&gt;&lt;br/&gt;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),&amp;nbsp;&lt;br/&gt;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%). &lt;br/&gt;&lt;br/&gt;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. &lt;br/&gt;&lt;br/&gt;Can anyone help me to understand this?&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;</description><pubDate>Fri, 12 Jun 2020 15:42:30 GMT</pubDate><dc:creator>KatrinaMcDonough</dc:creator></item><item><title>RE: How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?</title><link>https://forums.millisecond.com/Topic29223.aspx</link><description>Makes total sense!&lt;br/&gt;Thank you for your help &lt;br/&gt;&lt;br/&gt;</description><pubDate>Fri, 12 Jun 2020 15:42:30 GMT</pubDate><dc:creator>KatrinaMcDonough</dc:creator></item><item><title>RE: How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?</title><link>https://forums.millisecond.com/Topic29220.aspx</link><description>&lt;blockquote data-id="29219" class="if-quote-wrapper" unselectable="on" data-guid="1591966572743" id="if_insertedNode_1591966572207" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29219" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29219" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29219" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;KatrinaMcDonough - 6/12/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29219"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;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.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;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%). &lt;br/&gt;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). &lt;br/&gt;&lt;br/&gt;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), &lt;br/&gt;which in percentages, equates to&amp;nbsp;A(25%, 32%), B(75%, 32%), C(25%, 67%), D(75%, 67%). So this suggests the size of the rectangle is actually (50%, 35%).&amp;nbsp;&lt;br/&gt;&lt;br/&gt;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),&amp;nbsp;&lt;br/&gt;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%). &lt;br/&gt;&lt;br/&gt;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. &lt;br/&gt;&lt;br/&gt;Can anyone help me to understand this?&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29219"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;I'm completely unable to reproduce this, I'm afraid. Here's the very simple test code I used, which should be in line with yours&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=myshape, resolution]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ screencapture = true&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape myshape&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = lightblue&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;/ size = (50%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text resolution&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%display.width%&amp;gt; x &amp;lt;%display.height%&amp;gt;")&lt;br/&gt;/ position = (50%, 5%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;and attached below are three screen captures across three different screen resolutions. In every case, as far as I can determine, the pixel coordinates and dimensions are correct and exactly what should be expected under the given screen resolution.&lt;br/&gt;</description><pubDate>Fri, 12 Jun 2020 14:54:10 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?</title><link>https://forums.millisecond.com/Topic29222.aspx</link><description>&lt;blockquote data-id="29221" class="if-quote-wrapper" unselectable="on" data-guid="1591973206934" id="if_insertedNode_1591973206188" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29221" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29221" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29221" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;KatrinaMcDonough - 6/12/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29221"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Thanks for the quick reply! Yours seems to work fine when you draw the rectangle in inquisit, I actually just used an image of a rectangle:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=myshape, resolution]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ screencapture = true&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture myshape&amp;gt;&lt;br/&gt;/ items = ("box.jpg")&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;/ size = (50%, 50%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text resolution&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%display.width%&amp;gt; x &amp;lt;%display.height%&amp;gt;")&lt;br/&gt;/ position = (50%, 5%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29221"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;&amp;gt; Yours seems to work fine when you draw the rectangle in inquisit, I actually just used an image of a rectangle:&lt;br/&gt;&lt;br/&gt;Ah, yes. That explains it then. Inquisit will not distort the original image's inherent aspect ratio. That's the intended behavior. Your box image is 1920 x 1080 pixels, so 16:9 aspect ratio, and that will be preserved.&lt;br/&gt;</description><pubDate>Fri, 12 Jun 2020 14:51:55 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?</title><link>https://forums.millisecond.com/Topic29221.aspx</link><description>Thanks for the quick reply! Yours seems to work fine when you draw the rectangle in inquisit, I actually just used an image of a rectangle:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=myshape, resolution]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ screencapture = true&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture myshape&amp;gt;&lt;br/&gt;/ items = ("box.jpg")&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;/ size = (50%, 50%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text resolution&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%display.width%&amp;gt; x &amp;lt;%display.height%&amp;gt;")&lt;br/&gt;/ position = (50%, 5%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Fri, 12 Jun 2020 14:08:19 GMT</pubDate><dc:creator>KatrinaMcDonough</dc:creator></item></channel></rss>