\r
if (vertical) {\r
float height = getHeight() - bg.getTopHeight() - bg.getBottomHeight();\r
- sliderPos = y - knob.getMinHeight() * 0.5f;\r
+ sliderPos = y- bg.getBottomHeight() - knob.getMinHeight() * 0.5f;\r
sliderPos = Math.max(0, sliderPos);\r
sliderPos = Math.min(height - knob.getMinHeight(), sliderPos);\r
value = min + (max - min) * (sliderPos / (height - knob.getMinHeight()));\r
} else {\r
- float width = getWidth();\r
- sliderPos = x - knob.getMinWidth() * 0.5f;\r
+ float width = getWidth() - bg.getLeftWidth() - bg.getRightWidth();\r
+ sliderPos = x - bg.getLeftWidth() - knob.getMinWidth() * 0.5f;\r
sliderPos = Math.max(0, sliderPos);\r
sliderPos = Math.min(width - knob.getMinWidth(), sliderPos);\r
value = min + (max - min) * (sliderPos / (width - knob.getMinWidth()));\r