/*!
 \brief Scrolls the view by the amount indicated by "delta".
 
 Checks the direction of pan gesture and promotes leading direction.
 
 \param delta Move offset
 \return Returns TRUE if the view was able to scroll, FALSE otherwise
 */
bool CalenDayContentScrollArea::scrollByAmount(const QPointF &delta)
{
    QPointF newDelta(delta);
    if (mPanDayDirection == ECalenPanVertical) {
        newDelta.setX(0);
    }
    else
        if (mPanDayDirection == ECalenPanHorizontal) {
            newDelta.setY(0);
        }
        else {
            // Pan direction not set
        }

    return HbScrollArea::scrollByAmount(newDelta);
}
Пример #2
0
void Camera3D::move(const Vec3& deltaMove)
{
  if (stickToTarget())
  {
    Matrix translationMatrix = Matrix::translate(Vec3(0.0f, 0.0f, deltaMove.z));
    Vec3 currentTarget(target());
    position(translationMatrix * mPosition);
    target(currentTarget);
  }
  else
  {
    Vec3              newDelta(Matrix::rotateZ(mRotation.z) * Matrix::rotateY(mRotation.y) * Matrix::rotateX(mRotation.x) * deltaMove);
    Matrix translationMatrix = Matrix::translate(newDelta);
    position(translationMatrix * mPosition);
  }
  needsUpdate = true;
}