1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Minor string tweaks.

This commit is contained in:
Julian Storer 2010-03-15 18:48:36 +00:00
parent 45c6f4c124
commit 06fb01aab3
7 changed files with 182 additions and 186 deletions

View file

@ -382,18 +382,9 @@ public:
if (! screenArea.contains (lastScreenPos))
{
const Point<int> compPos (current->getScreenPosition());
int deltaX = 0, deltaY = 0;
if (lastScreenPos.getX() <= screenArea.getX() || lastScreenPos.getX() >= screenArea.getRight())
deltaX = compPos.getX() + current->getWidth() / 2 - lastScreenPos.getX();
if (lastScreenPos.getY() <= screenArea.getY() || lastScreenPos.getY() >= screenArea.getBottom())
deltaY = compPos.getY() + current->getHeight() / 2 - lastScreenPos.getY();
const Point<int> delta (deltaX, deltaY);
unboundedMouseOffset -= delta;
Desktop::setMousePosition (lastScreenPos + delta);
const Point<int> componentCentre (current->getScreenBounds().getCentre());
unboundedMouseOffset += (lastScreenPos - componentCentre);
Desktop::setMousePosition (componentCentre);
}
else if (isCursorVisibleUntilOffscreen
&& (! unboundedMouseOffset.isOrigin())