You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Mihai Chira <mi...@gmail.com> on 2015/03/01 11:30:46 UTC

Fwd: Re: [jira] (FLEX-34756) How to know when the textFlow is damaged?

(Forgot to include dev)
---------- Forwarded message ----------
From: "Mihai Chira" <mi...@gmail.com>
Date: 1 Mar 2015 11:30
Subject: Re: [jira] (FLEX-34756) How to know when the textFlow is damaged?
To: "Alex Harui" <ah...@adobe.com>
Cc:

Good idea, Alex, thanks. I'll do just that next week.

And yes, that's exactly why I need the method - so I can prevent Squiggly
from spell checking when the textFlow is damaged (as this can sometimes
cause the fatal), until the text field recomposes in the next frame.
On 27 Feb 2015 22:33, "Alex Harui" <ah...@adobe.com> wrote:

> I would think you could refactor FlowComposerBase so that all the code in
> isDamaged moves to some new method called
> ‘whetherFlowComposeBaseThinksTheTextFlowIsDamaged’.
> FlowComposerBase.isDamaged would call that and StandardFlowComposer would
> override it, but Squiggly could call the new method.
>
> That said, it might still be better for Squiggly to run after composition,
> not on damage.
>
> -Alex
>
> On 2/27/15, 9:14 AM, "Mihai Chira" <mi...@gmail.com> wrote:
>
> >Hi Alex,
> >
> >I'm not sure what you mean by "why not add enough code to get its
> >value"? In my mind, I can't get the value of
> >FlowComposerBase.isDamaged() because all text fields have a
> >StandardFlowComposer by default (and I can't change this, because I'm
> >in Squiggly, so I have to assume things are in their default setup),
> >which overrides this function to return something I can't use anymore.
> >What am I missing?
> >
> >Or do you mean temporarily changing the TextFlow.flowComposer that
> >extends FlowComposerBase to each text field every time I would need to
> >check to see if the textFlow is damaged?
> >(No, sorry, that wouldn't work, because it wouldn't have any
> >information about the damage that occurred before this reset of
> >composer.)
> >
> >Sorry, I'm still out of ideas.
> >
> >On 25 February 2015 at 18:33, Alex Harui <ah...@adobe.com> wrote:
> >> If FlowComposerBase.isDamaged() is returning the answer you want, why
> >>not
> >> add enough code to get its value?
> >>
> >> IIRC, the RichTextEditor and TLF have some logic to do a compose().  I
> >> would think you would want Squiggly to run whenever the compose()
> >> finishes, not when it is damaged.
> >>
> >> -Alex
> >>
> >> On 2/25/15, 3:12 AM, "Mihai Chira" <mi...@apache.org> wrote:
> >>
> >>>bump. Any ideas from people more experienced with tlf? Thank you.
> >>>
> >>>On 19 February 2015 at 15:44, Mihai Chira <mi...@gmail.com>
> wrote:
> >>>> How can I see if a RichEditableText's textFlow is damaged?
> >>>>
> >>>> From my investigations, it seems that FlowComposerBase.isDamaged()
> >>>> offers the perfect solution, but that it's then overridden in
> >>>> StandardFlowComposer.isDamaged() to return true if the
> >>>> RichEditableText allows scrolling. So if a text field allows scrolling
> >>>> (even if it's not scrolled at the moment), the textFlow will ALWAYS
> >>>> appear broken. How can this be useful?
> >>>>
> >>>> (I need to know whether a textFlow is damaged because I want to fix
> >>>> FLEX-34756[1] by preventing SpellUI from spell checking when the
> >>>> textFlow is damaged - the assumption being that it will be recomposed
> >>>> on the next frame. If you can think of a better solution, please let
> >>>> me know.
> >>>>
> >>>>
> >>>> Thanks!
> >>>>
> >>>> [1] https://issues.apache.org/jira/browse/FLEX-34756
> >>>> Summary of bug:
> >>>> -squiggly is set to spell check when the focus returns to a text field
> >>>> (see SpellUI.handleFocusIn())
> >>>> -after making changes to the text, the RichEditableText's textFlow is
> >>>> damaged and has to be recomposed. This normally happens in the next
> >>>> frame, when RichEditableText.updateDisplayList calls
> >>>> _textContainerManager.updateContainer().
> >>>> -BUT if we set focus on the RichEditableText after the text change,
> >>>> squiggly does the spell checking on the damaged textFlow.
> >>>> -because of this, it's offered bad indexes in
> >>>> SpellUI.getValidFirstWordIndex() and SpellUI.getValidLastWordIndex(),
> >>>> thus checking on non-existing text.
> >>
>
>