fix: Frame may be offset in parent window and not at { 0, 0 }

This commit is contained in:
Stuart Carnie
2020-11-16 06:50:00 +11:00
parent 9fb5bbbada
commit 0717b43318
+2 -2
View File
@@ -169,8 +169,8 @@
screenRect.size.width *= scale;
screenRect.size.height *= scale;
screenRect.origin.x = CGRectGetMidX(frame) - CGRectGetWidth(screenRect) / 2;
screenRect.origin.y = CGRectGetMidY(frame) - CGRectGetHeight(screenRect) / 2;
screenRect.origin.x = CGRectGetMidX(frame) - frame.origin.x - CGRectGetWidth(screenRect) / 2;
screenRect.origin.y = CGRectGetMidY(frame) - frame.origin.y - CGRectGetHeight(screenRect) / 2;
location.x -= screenRect.origin.x;
location.y -= screenRect.origin.y;