2 Replies Latest reply on Nov 6, 2007 6:10 AM by VikingBrewing

    How does Label Rotation Work?

    VikingBrewing
      rotated text:

      <mx:Label id="sliderLabel" text="Home"
      rotation="90" height="75" width="17" y="17" x="228" textAlign="left" color="#000000"/>

      I set this rotation to 90 which gives me the rotated text correctly. The problem here is that this label is up against the right hand side of a canvas. The width is set appropriately to give what the thing should be (taller than wide) as it would look.

      Using this width, the text (which should be "Home") shows as "H..." as though it it calculating the size before rotation.

      If I set the width to say 100, then I get the right text, correctly rotated, but it extends the label out over the canvas and obscured the edge the background image has there (i.e. it actually creates a 100 width label that covers up the edge, rotates the text, but doesn't rotate the box it's in).

      what's a person supposed to do with rotated text here? It's almost like they use the X,Y coordinates correctly but then keep H,W params in the unrotated coordinates.

      same behaviour in 2.0.1HF3 or Flex 3M2
        • 1. Re: How does Label Rotation Work?
          Peter deHaan Level 4
          VikingBrewing,

          Correct, you set the width/height normally, regardless of the rotation value. So to have the text display correctly, you'd set the width to 75 and the height to 17 in the previous example.

          Peter
          • 2. Re: How does Label Rotation Work?
            VikingBrewing Level 1
            The problem here is that since this thing site at the right side of the canvas and I want it tight to the right side, the (normal) placement of the label is obscuring the background or some such thing and causing that edge to not render correctly like the control is there in the horizontal position.

            Is there a way around this behaviour or must these things be done with enough clearance around the edges to not do this?

            Code for the thing is: