mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-23 20:20:09 +00:00
Merge pull request #803 from c64kernal/dev_hud
Fixed two issues with HUD sliders.
This commit is contained in:
commit
15a40ecc68
@ -528,7 +528,7 @@ Hud::Rebuild(int width, int height, int framebufferWidth, int framebufferHeight)
|
||||
x = drawChar(_staticVboSource, x, y, 1, 1, 1, FONT_SLIDER_MIDDLE);
|
||||
}
|
||||
drawChar(_staticVboSource, x, y, 1, 1, 1, FONT_SLIDER_RIGHT);
|
||||
int pos = (int)((it->value/float(it->max-it->min))*it->w);
|
||||
int pos = int(((it->value-it->min)/(it->max-it->min))*float(it->w));
|
||||
drawChar(_staticVboSource, sx+pos, y, 1, 1, 0, FONT_SLIDER_CURSOR);
|
||||
}
|
||||
// draw pulldowns
|
||||
|
@ -127,11 +127,12 @@ protected:
|
||||
bool intStep;
|
||||
|
||||
void SetValue(float v) {
|
||||
value = std::max(std::min(v, max), min);
|
||||
v = std::max(std::min(v, max), min);
|
||||
if (intStep) {
|
||||
// MSVC 2010 does not have std::round() or roundf()
|
||||
value = v>0.0f ? floor(v+0.5f) : ceil(v-0.5f);
|
||||
v = v>0.0f ? floor(v+0.5f) : ceil(v-0.5f);
|
||||
}
|
||||
value = v;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user