Commit 7acd7354 by Corentin Wallez

Revert "Revert "OSXWindow: fix window size and position computations""

This reverts commit 67d81044. Change-Id: I4fcaffeb161d22c1cea72fd764461b0c38024e01 Reviewed-on: https://chromium-review.googlesource.com/322214Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 70c27e8e
......@@ -116,14 +116,14 @@ int main(int argc, char *argv[])
if (window->getWidth() != width || window->getHeight() != height)
{
std::cout << "Discrepancy between set dimensions and retrieved dimensions" << std::endl;
std::cout << "Width: " << window->getWidth() << " vs. " << width << std::endl;
std::cout << "Height: " << window->getHeight() << " vs. " << height << std::endl;
std::cout << "Width: " << width << " vs. " << window->getWidth() << std::endl;
std::cout << "Height: " << height << " vs. " << window->getHeight() << std::endl;
}
if (window->getX() != x || window->getY() != y)
{
std::cout << "Discrepancy between set position and retrieved position" << std::endl;
std::cout << "X: " << window->getX() << " vs. " << x << std::endl;
std::cout << "Y: " << window->getY() << " vs. " << y << std::endl;
std::cout << "X: " << x << " vs. " << window->getX() << std::endl;
std::cout << "Y: " << y << " vs. " << window->getY() << std::endl;
}
}
}
......
......@@ -120,7 +120,7 @@ static float YCoordToFromCG(float y)
- (void) windowDidResize: (NSNotification*) notification
{
NSSize windowSize = [mWindow->getNSWindow() frame].size;
NSSize windowSize = [[mWindow->getNSWindow() contentView] frame].size;
Event event;
event.Type = Event::EVENT_RESIZED;
event.Size.Width = windowSize.width;
......@@ -130,7 +130,7 @@ static float YCoordToFromCG(float y)
- (void) windowDidMove: (NSNotification*) notification
{
NSRect screenspace = [mWindow->getNSWindow() contentRectForFrameRect:[mWindow->getNSWindow() frame]];
NSRect screenspace = [mWindow->getNSWindow() frame];
Event event;
event.Type = Event::EVENT_MOVED;
event.Move.X = screenspace.origin.x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment