Ejemplo n.º 1
0
void TrackBar::OnMouseMove( int mX, int mY, bool mouseState ) {
	if(m_is_readonly || !canChange()) return;
	const Rect& rect = GetRect();
	if(mouseState) {
		if(m_is_vertical) {
			
			int y = clip(rect.h - (mY), m_slider_radius/2, rect.h - m_slider_radius/2);
			
			if(y != m_slider_pix) {
				m_slider_pix = y;
				onChange();
			}
		} else {
			
			int x = clip(mX, m_slider_radius/2, rect.w-m_slider_radius/2);
			
			if(x != m_slider_pix) {
				m_slider_pix = x;
				onChange();
			}
		}
	} else {
		Rect sr = getSliderRect();
		int x = mX - (sr.x+sr.w/2);
		int y = mY - (sr.y+sr.h/2);
		if(x*x + y*y < m_slider_radius*m_slider_radius) {
			m_on_it = true;
			return;
		}
		m_on_it = false;
	}
}
Ejemplo n.º 2
0
void SampledEffect::removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>& replacedProperties)
{
    if (canChange() && m_animation->isCurrent())
        return;

    size_t dest = 0;
    for (size_t i = 0; i < m_interpolations->size(); i++) {
        if (!replacedProperties.get(toStyleInterpolation(m_interpolations->at(i).get())->id()))
            m_interpolations->at(dest++) = m_interpolations->at(i);
    }
    m_interpolations->shrink(dest);
}