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!
[Patch - b89] getVBL capture and locale fix
Moderators: dorpond, trevor, Azhrei
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
[Patch - b89] getVBL capture and locale fix
- Attachments
-
- Patch - getVBL capture and locale fix.txt
- (3.67 KiB) Downloaded 148 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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [Patch - b89] getVBL capture and locale fix
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.
(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.
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [Patch - b89] getVBL capture and locale fix
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
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [Patch - b89] getVBL capture and locale fix
Applied and committed. We're now at rev 5975.
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [Patch - b89] getVBL capture and locale fix
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork