Ton't try to render thumb position without a thumb

This commit is contained in:
Jordan Eldredge 2021-06-29 20:01:11 -07:00
parent 45dc7a42f7
commit 13a6791f84

View file

@ -116,9 +116,11 @@ export default class Slider extends GuiObj {
}
_renderThumbPosition() {
const bitmap = UI_ROOT.getBitmap(this._thumb);
const left = this._position * (this.getwidth() - bitmap.getWidth() / 2);
this._thumbDiv.style.left = px(left);
if (this._thumb != null) {
const bitmap = UI_ROOT.getBitmap(this._thumb);
const left = this._position * (this.getwidth() - bitmap.getWidth() / 2);
this._thumbDiv.style.left = px(left);
}
}
_renderBindings() {