mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 19:13:54 +00:00
[Modern] Correctly account for full thumb width in slider positioning
This commit is contained in:
parent
7996a2de47
commit
f4ca71cd8d
1 changed files with 2 additions and 3 deletions
|
|
@ -179,11 +179,10 @@ export default class Slider extends GuiObj {
|
|||
const bitmap = UI_ROOT.getBitmap(this._thumb);
|
||||
// TODO: What if the orientation has changed?
|
||||
if (this._vertical) {
|
||||
const top =
|
||||
this._position * (this.getheight() - bitmap.getHeight() / 2);
|
||||
const top = this._position * (this.getheight() - bitmap.getHeight());
|
||||
this._thumbDiv.style.top = px(top);
|
||||
} else {
|
||||
const left = this._position * (this.getwidth() - bitmap.getWidth() / 2);
|
||||
const left = this._position * (this.getwidth() - bitmap.getWidth());
|
||||
this._thumbDiv.style.left = px(left);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue