|
@@ -34,6 +34,27 @@ export class ImageBasedSlider extends BaseSlider {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * Gets or sets the image used to render the value bar
|
|
|
|
+ */
|
|
|
|
+ public get valueBarImage(): Image {
|
|
|
|
+ return this._valueBarImage;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public set valueBarImage(value: Image) {
|
|
|
|
+ if (this._valueBarImage === value) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this._valueBarImage = value;
|
|
|
|
+
|
|
|
|
+ if (value && !value.isLoaded) {
|
|
|
|
+ value.onImageLoadedObservable.addOnce(() => this._markAsDirty());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this._markAsDirty();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Gets or sets the image used to render the thumb
|
|
* Gets or sets the image used to render the thumb
|
|
*/
|
|
*/
|
|
public get thumbImage(): Image {
|
|
public get thumbImage(): Image {
|
|
@@ -82,12 +103,30 @@ export class ImageBasedSlider extends BaseSlider {
|
|
// Background
|
|
// Background
|
|
if (this._backgroundImage) {
|
|
if (this._backgroundImage) {
|
|
this._tempMeasure.copyFromFloats(left, top, width, height);
|
|
this._tempMeasure.copyFromFloats(left, top, width, height);
|
|
|
|
+ if (this.isThumbClamped) {
|
|
|
|
+ if (this.isVertical) {
|
|
|
|
+ this._tempMeasure.height += this._effectiveThumbThickness;
|
|
|
|
+ } else {
|
|
|
|
+ this._tempMeasure.width += this._effectiveThumbThickness;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
this._backgroundImage._draw(this._tempMeasure, context);
|
|
this._backgroundImage._draw(this._tempMeasure, context);
|
|
}
|
|
}
|
|
|
|
|
|
// Bar
|
|
// Bar
|
|
if (this._valueBarImage) {
|
|
if (this._valueBarImage) {
|
|
-
|
|
|
|
|
|
+ if (this.isVertical) {
|
|
|
|
+ this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition);
|
|
|
|
+ if (this.isThumbClamped) {
|
|
|
|
+ this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, this._currentMeasure.height - thumbPosition);
|
|
|
|
+ } else {
|
|
|
|
+ this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this._tempMeasure.copyFromFloats(left, top, thumbPosition, height);
|
|
|
|
+ }
|
|
|
|
+ this._valueBarImage._draw(this._tempMeasure, context);
|
|
}
|
|
}
|
|
|
|
|
|
// Thumb
|
|
// Thumb
|