7kia / ISpringPractic

0 stars 0 forks source link

Подозрительный код в CSelectedShape #19

Closed alexey-malov closed 7 years ago

alexey-malov commented 7 years ago
void CSelectedShape::HandleMoveMouse(const Vec2f point)
{
    switch (m_updateType)
    {
    case UpdateType::None:
        {

        }
        break;
    case UpdateType::MarkerLeftTop:
    case UpdateType::MarkerLeftBottom:
    case UpdateType::MarkerRightBottom:
    case UpdateType::MarkerRightTop:
    case UpdateType::Move:
        {
            if (m_startMove == Vec2f())
            {
                m_startMove = point;
                m_start = point;
            }
            m_current = point;

            SetFrameData(GetCurrentFrameData());
            m_start = m_current;

        }
        break;
    default:
        break;
    }
}
alexey-malov commented 7 years ago

SSize CSelectedShape::GetChangeResize() const
{
    SSize result;
    switch (m_updateType)
    {
    case UpdateType::MarkerLeftTop:
    {
        return SSize(-1.f, -1.f);
    }
    break;
    case UpdateType::MarkerLeftBottom:
    {
        return SSize(-1.f, 1.f);
    }
    break;
    case UpdateType::MarkerRightBottom:
    {
        return SSize(1.f, 1.f);
    }
    break;
    case UpdateType::MarkerRightTop:
    {
        return SSize(1.f, -1.f);
    }
    break;
    default:
        break;
    }