Skip to content
Snippets Groups Projects
Commit eec31898 authored by Nick's avatar Nick :v:
Browse files

cyanogen, aspectRatio is NOT height/width!!

parent e767ecd2
No related branches found
No related tags found
No related merge requests found
......@@ -74,14 +74,14 @@ VirtualDisplay::~VirtualDisplay() {
Rect VirtualDisplay::getDisplayRect() {
uint32_t outWidth, outHeight;
if (mWidth > (uint32_t)((float)mWidth * aspectRatio())) {
if (mWidth <= (uint32_t)((float)mHeight * aspectRatio())) {
// limited by narrow width; reduce height
outWidth = mWidth;
outHeight = (uint32_t)((float)mWidth * aspectRatio());
outHeight = (uint32_t)((float)mWidth / aspectRatio());
} else {
// limited by short height; restrict width
outHeight = mHeight;
outWidth = (uint32_t)((float)mHeight / aspectRatio());
outWidth = (uint32_t)((float)mHeight * aspectRatio());
}
// position the desktop in the viewport while preserving
......
......@@ -51,7 +51,7 @@ class VirtualDisplay : public RefBase {
private:
float aspectRatio() {
return (float)mSourceRect.getHeight() / (float)mSourceRect.getWidth();
return (float)mSourceRect.getWidth() / (float)mSourceRect.getHeight();
}
// Producer side of queue, passed into the virtual display.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment