Jump to content


Vilsol's Content

There have been 3 items by Vilsol (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#240154 [1.74] Major Window API Bug

Posted by Vilsol on 11 December 2015 - 03:15 PM in Bugs

Thanks and awesome, now I can continue working on the OS ^^



#240142 [1.74] Major Window API Bug

Posted by Vilsol on 11 December 2015 - 11:30 AM in Bugs

I'm at insomnia right now, but I will try to find it for Monday or Tuesday.

You can also test all that with the wiki test program.



#230802 [1.74] Major Window API Bug

Posted by Vilsol on 21 August 2015 - 07:37 PM in Bugs

Hello. I looked all around the forums and I couldn't find anyone creating a topic about this, so here it goes.

Here is a GIF of it in action. This is the program that is available on the wiki: http://www.computerc...ndow.reposition

Posted Image

As you can see, there is a really weird bug where the window size is drawn sometimes larger and sometimes smaller than it actually is.

I ran another test, and really, it draws it larger than it actually is. Here is a GIF of where I iterate from 1 to 20 and set it as the width of the window, then loop over the width of the window and color each column in a different color. As you can see, it draws the box exactly twice minus one as wide as I set it.

Posted Image

Looking at the Window API source, I figured it is because each time the window is re-positioned, the contents of it are multiplied, not just added a blank space.

Here are the lines 402 to 404 in the source:
text = tOldLine.text .. string_sub( sEmptyText, 1, nWidth + 1, nNewWidth ),
textColor = tOldLine.textColor .. string_sub( sEmptyTextColor, 1, nWidth + 1, nNewWidth ),
backgroundColor = tOldLine.backgroundColor .. string_sub( sEmptyBackgroundColor, 1, nWidth + 1, nNewWidth ),

Here is what they should be
text = tOldLine.text .. string_sub( sEmptyText, 1, nNewWidth - (nWidth + 1)),
textColor = tOldLine.textColor .. string_sub( sEmptyTextColor, 1, nNewWidth - (nWidth + 1)),
backgroundColor = tOldLine.backgroundColor .. string_sub( sEmptyBackgroundColor, 1, nNewWidth - (nWidth + 1)),

If they are changed, this is the result:

Posted Image

The same DOES NOT apply to the height, as that is calculated differently from the width.

I really hope this is fixed in the future versions.