generated from sigonasr2/CPlusPlusProjectTemplate
Cohesion turns into normal mode if the window becomes too small
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
f717f7ef09
commit
1f9abd2685
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 2.0 MiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -3357,11 +3357,13 @@ namespace olc
|
|||||||
int bh = vScreenSize.y*vPixelSize.y/baseFactor;
|
int bh = vScreenSize.y*vPixelSize.y/baseFactor;
|
||||||
|
|
||||||
int32_t xmult = vWindowSize.x / bw;
|
int32_t xmult = vWindowSize.x / bw;
|
||||||
|
if (xmult==0) goto nonPixelCohesion;
|
||||||
vViewSize.x = (vWindowSize.x / bw) * bw;
|
vViewSize.x = (vWindowSize.x / bw) * bw;
|
||||||
vViewSize.y = bh*xmult;
|
vViewSize.y = bh*xmult;
|
||||||
vScreenPixelSize = vPixelSize*xmult/baseFactor;
|
vScreenPixelSize = vPixelSize*xmult/baseFactor;
|
||||||
if (vWindowSize.x / bw > vWindowSize.y / bh) {
|
if (vWindowSize.x / bw > vWindowSize.y / bh) {
|
||||||
int32_t ymult = vWindowSize.y / bh;
|
int32_t ymult = vWindowSize.y / bh;
|
||||||
|
if (ymult==0) goto nonPixelCohesion;
|
||||||
vViewSize.y = (vWindowSize.y / bh) * bh;
|
vViewSize.y = (vWindowSize.y / bh) * bh;
|
||||||
vViewSize.x = bw*ymult;
|
vViewSize.x = bw*ymult;
|
||||||
vScreenPixelSize = vPixelSize*ymult/baseFactor;
|
vScreenPixelSize = vPixelSize*ymult/baseFactor;
|
||||||
@ -3369,6 +3371,7 @@ namespace olc
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
nonPixelCohesion:
|
||||||
vViewSize.x = (int32_t)vWindowSize.x;
|
vViewSize.x = (int32_t)vWindowSize.x;
|
||||||
vViewSize.y = (int32_t)((float)vViewSize.x / wasp);
|
vViewSize.y = (int32_t)((float)vViewSize.x / wasp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user