[Patch - b89] getVBL capture and locale fix

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

[Patch - b89] getVBL capture and locale fix

Post by JamzTheMan »

Az, here's a patch for getVBL() function which fixes two issues:

1. The decimal issue for certain locales like Netherland.
2. Incomplete capture of VBL for passed in rectangle.

For #2, I used the same logic as draw/eraseVBL which constrains the rectangle within the w/h by subtracting the "thickness". A thickness of 0 is now allowed and is the default for getVBL rectangles passed in so it captures to the edge properly.

Hopefully these are the last bugs for VBL functions and it's ready for b90!
Attachments
Patch - getVBL capture and locale fix.txt
(3.67 KiB) Downloaded 146 times
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [Patch - b89] getVBL capture and locale fix

Post by Azhrei »

So why this approach? Wouldn't it be faster to multiply by 100, truncate to whole number, then divide by 100? That eliminates any locale issue and sticks to basic arithmetic instead of parsing strings.

(Btw, the NumberFormat wouldn't be changing and could be extracted into a constant class member.)

Let me know what you think of the above and I'll make the change. I've got the patch applied but didn't look at the code surrounding this so I don't want to make this change without asking you first. Safer that way. :)

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Patch - b89] getVBL capture and locale fix

Post by JamzTheMan »

Um, ya, i suppose that would be easier lol. I probably ran out of fingers and said, they must be a more complicated way of doing this!

Make it so #1
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [Patch - b89] getVBL capture and locale fix

Post by Azhrei »

Applied and committed. We're now at rev 5975.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Patch - b89] getVBL capture and locale fix

Post by JamzTheMan »

Thank you sir. I'll sync it up.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Post Reply

Return to “Testing”