Might have found a bug with box edges

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Might have found a bug with box edges

Post by guo »

Hi,

While working on box edges I noticed that the sprite for "bottom edge left" wasn't displaying on text boxes. The "bottom edge right" sprite displays properly but "bottom edge" displays in place of "bottom edge left".

I have tried to check this on both auto shrink and manual.
vvight.wordpress.com
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

They are always shown, except for when a bordered box is less than 27 pixels wide (of course, textboxes are fixed width). You are confused by the fact that the bottom edge piece is also drawn immediately underneath the bottom-left (and top-left) piece, while on the right hand side it only draws a bottom/top piece underneath if there would otherwise be a gap of at least once pixel.

I guess it is a bit inconsistent, and it means if there's something on the bottom edge you can't just cover up, you have a problem.
It's the way it is because of back-compat, but I probably wouldn't have written it that way if starting from scratch. If it's really a problem that you can't work around, adding a bitset is possible... I've never heard anyone else complain though.

In the example, all arrows are 16x16, going right to the edges of the boxes. You can see there are special cases for really thin boxes (including drawing clipped edge pieces). There are actually even more special cases for even smaller boxes.
Attachments
boxborders.png
boxborders.png (3.47 KiB) Viewed 401 times
boxborder arrows.bmp
boxborder arrows.bmp (2.12 KiB) Viewed 401 times
Last edited by TMC on Sat Aug 06, 2016 12:12 pm, edited 3 times in total.
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

Thanks for the reply. I went back and rechecked and now the bottom left edge piece is being drawn over the bottom edge again. I can't seem to replicate the occurrence.
vvight.wordpress.com
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Could it be that you uncovered some bug where you edited the box border sprites but the boxes continued to be drawn using the old sprites?
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

Perhaps, it seems to have righted itself for now. I'll update if I encounter it again, as I am still working on box edges.
vvight.wordpress.com
Post Reply