fix update loop, sticky slider bars

This commit is contained in:
David Rose 2008-06-12 19:00:29 +00:00
parent 855cb4d2ad
commit 6c26ee6d2e
1 changed files with 11 additions and 1 deletions

View File

@ -689,7 +689,17 @@ reposition() {
float t = get_ratio();
if (_thumb_button != (PGButton *)NULL) {
_thumb_button->set_transform(TransformState::make_pos((t * _range_x) * _axis + _thumb_start));
LPoint3f pos = (t * _range_x) * _axis + _thumb_start;
CPT(TransformState) transform = TransformState::make_pos(pos);
CPT(TransformState) orig_transform = _thumb_button->get_transform();
// It's important not to update the transform frivolously, or
// we'll get caught in an update loop.
if (transform == orig_transform) {
// No change.
} else if (*transform < *orig_transform || *orig_transform < *transform) {
_thumb_button->set_transform(transform);
}
}
}