1 Reply Latest reply on Oct 12, 2011 6:42 AM by Filmzaddict

    Runtime "pixel hinting" problem

    Filmzaddict

      I stumbled upon what looks like some kind of pixel hinting problem. I have an AIR window inside which i allow the user to drag the custom components around. I noticed that the position of images/buttons/other controls gets "jagged" sometimes after a component has been dragged around. It wont ever go back to normal looking state after that:

       

      pixel_hinting.png

      Notice the lower components buttons and images inside it. Has anyone came across a similar issue?

        • 1. Re: Runtime "pixel hinting" problem
          Filmzaddict Level 1

          I figured out the cause: I created these green rectangled components at runtime, and when i added it to the parent container i set their x and y positions like this: com.x = this.width/2, com.y = this.height/2. If the size of the container was an odd number the resulting x and y would be not be a whole number, it would be 144.5 for example. Seems that when i drag the component... the dragging procedure adds an integer to the current position so the position is different but 0.5 pixel off. Inside the component this causes the small displacement problem since some components fall on the left and some on the right side of a certain pixel.

           

          I ll workaround by casting to ints.