[haiku-commits] Re: r38589 - haiku/trunk/src/kits/interface

  • From: Urias McCullough <umccullough@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 8 Sep 2010 16:13:38 -0700

On Wed, Sep 8, 2010 at 4:02 PM, Urias McCullough <umccullough@xxxxxxxxx> wrote:
> On Wed, Sep 8, 2010 at 3:41 PM, Stephan Assmus <superstippi@xxxxxx> wrote:
>> If the string width changes and triggers a relayout, then so many things
>> happen, including tons of trips to the app_server not only for resizing, but
>> also for redrawing many things in this and other views, that the two extra
>> StringWidth() calls pale in comparison. However, if the string width does
>> not change often, like in the new MediaPlayer duration info view, then it's
>> good to avoid invalidating the layout unnecessarily.
>
> Maybe you can also check to see if the string value changed before
> calling the second StringWidth() ?

Bah, nevermind - ignore me ;)

By the time you'd stored the old value for comparison with the new
value, you wouldn't have to check StringWidth() of either value until
you had confirmed both values were not the same anyway - so I guess
what Clemens suggested makes sense, but you'd still want to fallback
to the StringWidth() comparison to save the massive hit on
InvalidateLayout() anyway I suspect.

- Urias

Other related posts: