Commit 34087533 by Corentin Wallez

OSXWindow: fix window size and position computations

Also improve debug messages in window_test. BUG=angleproject:1273 Change-Id: Ie47dc1d7ad3be5a55d2a199334bba606f2b45ad0 Reviewed-on: https://chromium-review.googlesource.com/322350 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent da66ed62
...@@ -116,14 +116,14 @@ int main(int argc, char *argv[]) ...@@ -116,14 +116,14 @@ int main(int argc, char *argv[])
if (window->getWidth() != width || window->getHeight() != height) if (window->getWidth() != width || window->getHeight() != height)
{ {
std::cout << "Discrepancy between set dimensions and retrieved dimensions" << std::endl; std::cout << "Discrepancy between set dimensions and retrieved dimensions" << std::endl;
std::cout << "Width: " << window->getWidth() << " vs. " << width << std::endl; std::cout << "Width: " << width << " vs. " << window->getWidth() << std::endl;
std::cout << "Height: " << window->getHeight() << " vs. " << height << std::endl; std::cout << "Height: " << height << " vs. " << window->getHeight() << std::endl;
} }
if (window->getX() != x || window->getY() != y) if (window->getX() != x || window->getY() != y)
{ {
std::cout << "Discrepancy between set position and retrieved position" << std::endl; std::cout << "Discrepancy between set position and retrieved position" << std::endl;
std::cout << "X: " << window->getX() << " vs. " << x << std::endl; std::cout << "X: " << x << " vs. " << window->getX() << std::endl;
std::cout << "Y: " << window->getY() << " vs. " << y << std::endl; std::cout << "Y: " << y << " vs. " << window->getY() << std::endl;
} }
} }
} }
......
...@@ -120,7 +120,7 @@ static float YCoordToFromCG(float y) ...@@ -120,7 +120,7 @@ static float YCoordToFromCG(float y)
- (void) windowDidResize: (NSNotification*) notification - (void) windowDidResize: (NSNotification*) notification
{ {
NSSize windowSize = [mWindow->getNSWindow() frame].size; NSSize windowSize = [[mWindow->getNSWindow() contentView] frame].size;
Event event; Event event;
event.Type = Event::EVENT_RESIZED; event.Type = Event::EVENT_RESIZED;
event.Size.Width = windowSize.width; event.Size.Width = windowSize.width;
...@@ -130,7 +130,7 @@ static float YCoordToFromCG(float y) ...@@ -130,7 +130,7 @@ static float YCoordToFromCG(float y)
- (void) windowDidMove: (NSNotification*) notification - (void) windowDidMove: (NSNotification*) notification
{ {
NSRect screenspace = [mWindow->getNSWindow() contentRectForFrameRect:[mWindow->getNSWindow() frame]]; NSRect screenspace = [mWindow->getNSWindow() frame];
Event event; Event event;
event.Type = Event::EVENT_MOVED; event.Type = Event::EVENT_MOVED;
event.Move.X = screenspace.origin.x; 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