|
@@ -47,12 +47,12 @@ MouseEvent::MouseEvent (MouseInputSource inputSource, |
|
|
pressure (force),
|
|
|
pressure (force),
|
|
|
orientation (o), rotation (r),
|
|
|
orientation (o), rotation (r),
|
|
|
tiltX (tX), tiltY (tY),
|
|
|
tiltX (tX), tiltY (tY),
|
|
|
|
|
|
mouseDownPosition (downPos),
|
|
|
eventComponent (eventComp),
|
|
|
eventComponent (eventComp),
|
|
|
originalComponent (originator),
|
|
|
originalComponent (originator),
|
|
|
eventTime (time),
|
|
|
eventTime (time),
|
|
|
mouseDownTime (downTime),
|
|
|
mouseDownTime (downTime),
|
|
|
source (inputSource),
|
|
|
source (inputSource),
|
|
|
mouseDownPos (downPos),
|
|
|
|
|
|
numberOfClicks ((uint8) numClicks),
|
|
|
numberOfClicks ((uint8) numClicks),
|
|
|
wasMovedSinceMouseDown ((uint8) (mouseWasDragged ? 1 : 0))
|
|
|
wasMovedSinceMouseDown ((uint8) (mouseWasDragged ? 1 : 0))
|
|
|
{
|
|
|
{
|
|
@@ -70,21 +70,21 @@ MouseEvent MouseEvent::getEventRelativeTo (Component* const otherComponent) cons |
|
|
return MouseEvent (source, otherComponent->getLocalPoint (eventComponent, position),
|
|
|
return MouseEvent (source, otherComponent->getLocalPoint (eventComponent, position),
|
|
|
mods, pressure, orientation, rotation, tiltX, tiltY,
|
|
|
mods, pressure, orientation, rotation, tiltX, tiltY,
|
|
|
otherComponent, originalComponent, eventTime,
|
|
|
otherComponent, originalComponent, eventTime,
|
|
|
otherComponent->getLocalPoint (eventComponent, mouseDownPos),
|
|
|
|
|
|
|
|
|
otherComponent->getLocalPoint (eventComponent, mouseDownPosition),
|
|
|
mouseDownTime, numberOfClicks, wasMovedSinceMouseDown != 0);
|
|
|
mouseDownTime, numberOfClicks, wasMovedSinceMouseDown != 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
MouseEvent MouseEvent::withNewPosition (Point<float> newPosition) const noexcept
|
|
|
MouseEvent MouseEvent::withNewPosition (Point<float> newPosition) const noexcept
|
|
|
{
|
|
|
{
|
|
|
return MouseEvent (source, newPosition, mods, pressure, orientation, rotation, tiltX, tiltY,
|
|
|
return MouseEvent (source, newPosition, mods, pressure, orientation, rotation, tiltX, tiltY,
|
|
|
eventComponent, originalComponent, eventTime, mouseDownPos, mouseDownTime,
|
|
|
|
|
|
|
|
|
eventComponent, originalComponent, eventTime, mouseDownPosition, mouseDownTime,
|
|
|
numberOfClicks, wasMovedSinceMouseDown != 0);
|
|
|
numberOfClicks, wasMovedSinceMouseDown != 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
MouseEvent MouseEvent::withNewPosition (Point<int> newPosition) const noexcept
|
|
|
MouseEvent MouseEvent::withNewPosition (Point<int> newPosition) const noexcept
|
|
|
{
|
|
|
{
|
|
|
return MouseEvent (source, newPosition.toFloat(), mods, pressure, orientation, rotation,
|
|
|
return MouseEvent (source, newPosition.toFloat(), mods, pressure, orientation, rotation,
|
|
|
tiltX, tiltY, eventComponent, originalComponent, eventTime, mouseDownPos,
|
|
|
|
|
|
|
|
|
tiltX, tiltY, eventComponent, originalComponent, eventTime, mouseDownPosition,
|
|
|
mouseDownTime, numberOfClicks, wasMovedSinceMouseDown != 0);
|
|
|
mouseDownTime, numberOfClicks, wasMovedSinceMouseDown != 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
@@ -111,14 +111,14 @@ int MouseEvent::getLengthOfMousePress() const noexcept |
|
|
Point<int> MouseEvent::getPosition() const noexcept { return Point<int> (x, y); }
|
|
|
Point<int> MouseEvent::getPosition() const noexcept { return Point<int> (x, y); }
|
|
|
Point<int> MouseEvent::getScreenPosition() const { return eventComponent->localPointToGlobal (getPosition()); }
|
|
|
Point<int> MouseEvent::getScreenPosition() const { return eventComponent->localPointToGlobal (getPosition()); }
|
|
|
|
|
|
|
|
|
Point<int> MouseEvent::getMouseDownPosition() const noexcept { return mouseDownPos.roundToInt(); }
|
|
|
|
|
|
Point<int> MouseEvent::getMouseDownScreenPosition() const { return eventComponent->localPointToGlobal (mouseDownPos).roundToInt(); }
|
|
|
|
|
|
|
|
|
Point<int> MouseEvent::getMouseDownPosition() const noexcept { return mouseDownPosition.roundToInt(); }
|
|
|
|
|
|
Point<int> MouseEvent::getMouseDownScreenPosition() const { return eventComponent->localPointToGlobal (mouseDownPosition).roundToInt(); }
|
|
|
|
|
|
|
|
|
Point<int> MouseEvent::getOffsetFromDragStart() const noexcept { return (position - mouseDownPos).roundToInt(); }
|
|
|
|
|
|
int MouseEvent::getDistanceFromDragStart() const noexcept { return roundToInt (mouseDownPos.getDistanceFrom (position)); }
|
|
|
|
|
|
|
|
|
Point<int> MouseEvent::getOffsetFromDragStart() const noexcept { return (position - mouseDownPosition).roundToInt(); }
|
|
|
|
|
|
int MouseEvent::getDistanceFromDragStart() const noexcept { return roundToInt (mouseDownPosition.getDistanceFrom (position)); }
|
|
|
|
|
|
|
|
|
int MouseEvent::getMouseDownX() const noexcept { return roundToInt (mouseDownPos.x); }
|
|
|
|
|
|
int MouseEvent::getMouseDownY() const noexcept { return roundToInt (mouseDownPos.y); }
|
|
|
|
|
|
|
|
|
int MouseEvent::getMouseDownX() const noexcept { return roundToInt (mouseDownPosition.x); }
|
|
|
|
|
|
int MouseEvent::getMouseDownY() const noexcept { return roundToInt (mouseDownPosition.y); }
|
|
|
|
|
|
|
|
|
int MouseEvent::getDistanceFromDragStartX() const noexcept { return getOffsetFromDragStart().x; }
|
|
|
int MouseEvent::getDistanceFromDragStartX() const noexcept { return getOffsetFromDragStart().x; }
|
|
|
int MouseEvent::getDistanceFromDragStartY() const noexcept { return getOffsetFromDragStart().y; }
|
|
|
int MouseEvent::getDistanceFromDragStartY() const noexcept { return getOffsetFromDragStart().y; }
|
|
|