Exemplo n.º 1
0
 void handleMagnifyGesture (ComponentPeer& peer, Point<float> positionWithinPeer,
                            Time time, const float scaleFactor)
 {
     Point<float> screenPos;
     if (Component* current = getTargetForGesture (peer, positionWithinPeer, time, screenPos))
         sendMagnifyGesture (*current, screenPos, time, scaleFactor);
 }
Exemplo n.º 2
0
 void handleMagnifyGesture (ComponentPeer* const peer, const Point<int>& positionWithinPeer,
                            const Time& time, const float scaleFactor)
 {
     Point<int> screenPos;
     if (Component* current = getTargetForGesture (peer, positionWithinPeer, time, screenPos))
         sendMagnifyGesture (current, screenPos, time, scaleFactor);
 }
Exemplo n.º 3
0
    void handleWheel (ComponentPeer& peer, Point<int> positionWithinPeer,
                      Time time, const MouseWheelDetails& wheel)
    {
        Desktop::getInstance().incrementMouseWheelCounter();

        Point<int> screenPos;
        if (Component* current = getTargetForGesture (peer, positionWithinPeer, time, screenPos))
            sendMouseWheel (*current, screenPos, time, wheel);
    }
Exemplo n.º 4
0
    void handleWheel (ComponentPeer& peer, Point<float> positionWithinPeer,
                      Time time, const MouseWheelDetails& wheel)
    {
        Desktop::getInstance().incrementMouseWheelCounter();
        Point<float> screenPos;

        // This will make sure that when the wheel spins in its inertial phase, any events
        // continue to be sent to the last component that the mouse was over when it was being
        // actively controlled by the user. This avoids confusion when scrolling through nested
        // scrollable components.
        if (lastNonInertialWheelTarget == nullptr || ! wheel.isInertial)
            lastNonInertialWheelTarget = getTargetForGesture (peer, positionWithinPeer, time, screenPos);

        if (Component* target = lastNonInertialWheelTarget)
            sendMouseWheel (*target, screenPos, time, wheel);
    }