Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34653

Setting applicationDPI (autoscaling) on desktop works incorrectly.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Apache Flex 4.13.0
    • None
    • Layout - General, Skinning
    • Windows ( Possible Mac - Not checked ).

    Description

      The issue occurs when using automatic scaling and setting the application DPI and overriding the runtimeDPIProvider to set the runtimeDPI where it is incorrectly returned from the OS ( On desktop devices for instance ).

      If the two values match ie 1:1 scaling, there is no issue. But if they differ then the application content is scalled correctly , but the stage size is also scaled, incorrect. This leads to the application being clipped when scaling up and excess space when scaling down.. See code excepts to recreate...

      ScaleIssue.mxml
      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
      					   xmlns:s="library://ns.adobe.com/flex/spark" 
      					   xmlns:mx="library://ns.adobe.com/flex/mx"
      					   applicationDPI="160"
      					   runtimeDPIProvider="myRuntimeDPIProvider">
      	
      		<s:Label id="LeftMarker" left="0" verticalCenter="0" text="&lt;--- LEFT" fontSize="24"/>
      
      		<s:Label id="MiddleMarker" horizontalCenter="0" verticalCenter="0" text="&gt; &gt; &gt; MIDDLE &lt; &lt; &lt;" fontSize="24"/>
      
      		<s:Label id="RightMarker" right="0" verticalCenter="0" text="RIGHT ---&gt;" fontSize="24"/>
      							 
      </s:WindowedApplication>
      
      myRuntimeDPIProvider.as
      package 
      {
      	
      	import mx.core.DPIClassification;
      	import mx.core.RuntimeDPIProvider;
      	
      	public class myRuntimeDPIProvider extends RuntimeDPIProvider
      	{
      				
      		/**
      		 * Overrride getter function so we can set the dpi manually when running on desktop device
      		 * This would normally be a bit more sophisticated... 
      		 * 
      		 * @return 
      		 * 
      		 */		
      		override public function get runtimeDPI():Number
      		{			
      			return DPIClassification.DPI_240;
      		}
      		
      	}
      }
      

      You should see the text labels pointing to the left and right screen edges.. but instead the right hand label is off screen.

      Hope that makes sense.

      J

      Attachments

        1. Main.mxml
          0.9 kB
          Lee Burrows
        2. screenshot2.png
          23 kB
          Jim Moore
        3. screenshot.png
          35 kB
          Jim Moore

        Activity

          People

            Unassigned Unassigned
            jmoore Jim Moore
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: