mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 11:24:27 +01:00
gedbg: Allow grow and shrink to fit.
This commit is contained in:
1 parent
c6ffed6484
commit
6ebbf2cb72
2 files changed
+20
-4
No files matched your search
@@ -322,7 +322,7 @@ void SimpleGLWindow::GetContentSize(float &x, float &y, float &fw, float &fh) {
|
||||
x = 0.0f;
|
||||
y = 0.0f;
|
||||
|
||||
if (flags_ & (RESIZE_SHRINK_FIT | RESIZE_CENTER) && !zoom_) {
|
||||
if ((flags_ & RESIZE_SHRINK_FIT) != 0 && !zoom_) {
|
||||
float wscale = fw / w_, hscale = fh / h_;
|
||||
|
||||
// Too wide, and width is the biggest problem, so scale based on that.
|
||||
@@ -334,6 +334,17 @@ void SimpleGLWindow::GetContentSize(float &x, float &y, float &fw, float &fh) {
|
||||
fh = (float)h_;
|
||||
}
|
||||
}
|
||||
if ((flags_ & RESIZE_GROW_FIT) != 0) {
|
||||
float wscale = fw / w_, hscale = fh / h_;
|
||||
|
||||
if (wscale > hscale && wscale < 1.0f) {
|
||||
fw = (float)w_;
|
||||
fh /= wscale;
|
||||
} else if (hscale > wscale && hscale < 1.0f) {
|
||||
fw /= hscale;
|
||||
fh = (float)h_;
|
||||
}
|
||||
}
|
||||
if (flags_ & RESIZE_CENTER) {
|
||||
x = ((float)w_ - fw) / 2;
|
||||
y = ((float)h_ - fh) / 2;
|
||||
|
||||
Reference in new issue
Block a user