Skip to main content
Known Participant
December 7, 2009
Question

how can I override the blinking cursor in tlf

  • December 7, 2009
  • 1 reply
  • 799 views

Hi,

... if I edit a very small font, than the cursor is too wide, and when I write with a very big font, then blinking cursor is almost invisible...


... please help me to solve this poroblem...

thanks

This topic has been closed for replies.

1 reply

Known Participant
December 7, 2009

I would be very happy if someone would change

this line:    selObj.graphics.drawRect(int(x),int(y),w,h);
to this:            selObj.graphics.drawRect(x,y,w,h);

in the ContainerController class

... drawPointSelection method

(tlf_internal function drawPointSelection(selFormat:SelectionFormat, x:Number,y:Number,w:Number,h:Number):void)

around line No.: 2435

then I my solution would look like:

package ....
{
    import flash.display.Sprite;
   
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.edit.SelectionFormat;
    import flashx.textLayout.tlf_internal;

    use namespace tlf_internal;
   
    internal class ContainerControllerX extends ContainerController
    {
        public function ContainerControllerX(container:Sprite, compositionWidth:Number=100, compositionHeight:Number=100)
        {
            super(container, compositionWidth, compositionHeight);
        }

        override tlf_internal function drawPointSelection(selFormat:SelectionFormat, x:Number,y:Number,w:Number,h:Number):void
        {
            w == 1 ? w = h * .03125 : h = w * .03125;
            super.drawPointSelection(selFormat, x,y,w,h);
        }
    }
}

Adobe Employee
December 8, 2009

That is ugly and likely unnecessary - I'll file a bug - its late in the cycle and we're risk adverse right now.

Richard

Adobe Employee
December 8, 2009

The flooring has a purpose - it prevents the cursor from changing shape as it is moved from position to position - well in the 99% case.  For 2.0 this function can be made more easily overridable so you can get better custom cursor shaping.

Richard