This commit is contained in:
Christoph Oelckers 2016-08-14 22:11:17 +02:00
commit 0a555038e3
1 changed files with 2 additions and 6 deletions

View File

@ -345,16 +345,12 @@ DScroller::DScroller (double dx, double dy, const line_t *l,
int control, int accel, EScrollPos scrollpos)
: DThinker (STAT_SCROLLER)
{
if (tagManager.GetFirstLineID(l) == 300)
{
int a = 0;
}
double x = fabs(l->Delta().X), y = fabs(l->Delta().Y), d;
if (y > x) d = x, x = y, y = d;
d = x / g_sin(g_atan2(y, x) + M_PI / 2);
x = (-dy * l->Delta().Y + dx * l->Delta().X) / d;
y = (-dx * l->Delta().Y - dy * l->Delta().X) / d;
x = -(dy * l->Delta().Y + dx * l->Delta().X) / d;
y = -(dx * l->Delta().Y - dy * l->Delta().X) / d;
m_Type = EScroll::sc_side;
m_dx = x;