kengineer Posted November 7, 2016 Report Share Posted November 7, 2016 Why does the gwinProgressbarDecrement() function decrement by both the resolution and the minimum? Shouldn't it be one or the other, and if anything I would think we would always decrement by the resolution and cap it at the min. This also will allow the progress bar to fall outside the min range as an additional decrement of the step always occurs no matter what not to mention that if I want to decrement by 1 normally it will always decrement more. void gwinProgressbarDecrement(GHandle gh) { #define gsw ((GProgressbarObject *)gh) if (gh->vmt != (gwinVMT *)&progressbarVMT) return; if (gsw->pos > gsw->res) gsw->pos -= gsw->min; else gsw->pos = gsw->min; gsw->pos -= gsw->res; PBResetDisplayPos(gsw); _gwinUpdate(gh); #undef gsw } I would think it should be something more like this: void gwinProgressbarDecrement(GHandle gh) { #define gsw ((GProgressbarObject *)gh) if (gh->vmt != (gwinVMT *)&progressbarVMT) return; if (gsw->pos > gsw->min) gsw->pos -= gsw->res; else gsw->pos = gsw->min; PBResetDisplayPos(gsw); _gwinUpdate(gh); #undef gsw } Please clarify if I'm not understanding the use of this correctly. Link to comment Share on other sites More sharing options...
inmarket Posted November 7, 2016 Report Share Posted November 7, 2016 This is now fixed in the repository along with a couple of other bugs found when I reviewed the progressbar code. Link to comment Share on other sites More sharing options...
kengineer Posted November 8, 2016 Author Report Share Posted November 8, 2016 Thanks @inmarket! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now