Permalink
Browse files

Fix pulsing effect. Otherwise the left side of the control pulses, an…

…d the right side doesn't
  • Loading branch information...
1 parent c62a586 commit 06edd358d4e8c15baee0e9aef8c8a81ba265a302 @CrystalP committed Oct 2, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 xbmc/guilib/GUISettingsSliderControl.cpp
@@ -41,6 +41,8 @@ void CGUISettingsSliderControl::Process(unsigned int currentTime, CDirtyRegionLi
m_buttonControl.SetEnabled(m_enabled);
m_buttonControl.Process(currentTime, dirtyregions);
ProcessText();
+ if (HasFocus() && m_pulseOnSelect)
+ MarkDirtyRegion();
CGUISliderControl::Process(currentTime, dirtyregions);
}

2 comments on commit 06edd35

@pieh
pieh commented on 06edd35 Oct 20, 2011

I would rather do something like

if (m_buttonControl.IsMarkedDirty())
  MarkDirtyRegion();

Need to add simple IsMarkedDirty() getter but this way You don't have to get into too much details and it's more futureproof.

@CrystalP
Owner

I see what you're saying but I don't completely agree.
The underlying button handles the pulse effect, but pulse is not the only possible reason it gets dirty so that would do a bit more rendering than necessary.
My way is also not ideal in case the pulsing is made really slow and the alpha doesn't change for each frame.

Maybe best would be a 'dirty because of pulsing' getter in the button.

Please sign in to comment.