Cheesebaron / RippleEffect

Port of https://github.com/traex/RippleEffect
MIT License
10 stars 5 forks source link

Alpha issue #2

Open REDECODE opened 8 years ago

REDECODE commented 8 years ago

Hi, the last lines in Draw() method where is set Alpha is changed from the original java repository (in particular _timer variable).

The lines:

            _timer++;

            if (_rippleType == 1)
            {
                if ((((float) _timer * _frameRate) / _duration) > 0.6f)
                    _paint.Alpha =
                        (int) (_paintAlpha - (_paintAlpha * (((float) _timerEmpty * _frameRate) / _durationEmpty)));
                else
                    _paint.Alpha = _paintAlpha;
            }
            else
                _paint.Alpha = (int)(_paintAlpha - (_paintAlpha * (((float)_timerEmpty * _frameRate) / _duration)));

are now:

           if (_rippleType == 1)
            {
                if ((((float) _timer * _frameRate) / _duration) > 0.6f)
                    _paint.Alpha =
                        (int) (_paintAlpha - (_paintAlpha * (((float) _timerEmpty * _frameRate) / _durationEmpty)));
                else
                    _paint.Alpha = _paintAlpha;
            }
            else
                _paint.Alpha = (int)(_paintAlpha - (_paintAlpha * (((float)_timer * _frameRate) / _duration)));

            _timer++;
Cheesebaron commented 8 years ago

Make a pull request.