QB64-Phoenix-Edition / QB64pe

The QB64 Phoenix Edition Repository
https://qb64phoenix.com
Other
114 stars 24 forks source link

Graphical Error #349

Open TheXadGaming opened 1 year ago

TheXadGaming commented 1 year ago

For me anyway, when I Fullscreen the IDE there's a black bar on the top of the screen, offsetting everything down:

image

SteveMcNeill commented 1 year ago

Some times, it's impossible for there to NOT be a black bar on the screen. The IDE runs in SCREEN 0, so it's a text screen -- which means that it has to work with a monospaced font. Every line has to be the same height and every character has to be the same width.

Now, understanding that basic rule and limitation of our interface, let's go with the following configuration for our PC: Our desktop is 1000 pixels tall. (This makes for easy maths and illustration of the point.) We choose a font that is 10 pixels in height.
Our Title Bar is set by the system to be 20 pixels in height.

Now, how does this all play together to create a screen for us? We end up with a screen with a 20 pixel title bar and 98 rows of 10 pixel characters, with ZERO black space left over. Everything worked out perfectly, life is good, and our IDE is using the full screen.

Now, let's change that to where the system sets the Title Bar to being 24 pixels high, but everything else is the same -- 1000 pixel desktop height, 10 pixel font height. How's that work out?

We now have an IDE with a 24 pixel Title Bar and 97 rows of 10 pixels characters, with 6 pixels which we have to make a choice on: Do we create a partial row with 4 pixels missing? Or do we just leave those 6 pixels blank?? The Title Bar used 24 pixels, so we only have a total of 976 for the screen, and our font is 10 pixels in height. Just what the heck do we do with the leftover pixels??

Now, someone will say, "But fullscreen doesn't have a Title Bar!"

Doesn't matter -- it still has the same inherent math involved. Let's say our desktop is 1000 pixels in height. Our font in 11 pixels in height. 11 * 90 = 990, with 10 pixels left over that we have to decide: Partial row or blank row??

Nobody likes a partial row to text and buttons and such to interact with, so we chose a blank row for the IDE. The math just doesn't allow to NOT have it, if on wants to maintain a true monospace font ratio with their display.

mkilgore commented 1 year ago

@SteveMcNeill The problem is that the black bar is on the wrong side, it should be on the bottom but it's on the top.

I've had this happen to me at least once, the black bar ends up on the top and your mouse interactions act as though it's not there. When that happens to click on the menu you have to click in the black bar, not where it's drawn on screen. Something either in the IDE logic or internal libqb logic is drawing it offset from the bottom when all the rest of the logic is assuming it's drawn from the top.

SteveMcNeill commented 1 year ago

Ah! I can see where that'd end up causing issues. It's impossible to get rid of that black bar, but the way we calculate mouse positions also has to take it into consideration.