mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
19 lines
643 B
JavaScript
Executable File
19 lines
643 B
JavaScript
Executable File
import Utility from "../Utility.js"
|
|
import IDraggableControlTemplate from "./IDraggableControlTemplate.js"
|
|
|
|
/** @extends {IDraggableControlTemplate<ColorHandlerElement>} */
|
|
export default class ColorSliderTemplate extends IDraggableControlTemplate {
|
|
|
|
/**
|
|
* @param {Number} x
|
|
* @param {Number} y
|
|
* @return {Coordinates}
|
|
*/
|
|
adjustLocation(x, y) {
|
|
x = Utility.clamp(x, 0, this.movementSpaceSize[0])
|
|
y = Utility.clamp(y, 0, this.movementSpaceSize[1])
|
|
this.locationChangeCallback?.(x / this.movementSpaceSize[0], 1 - y / this.movementSpaceSize[1])
|
|
return [x, y]
|
|
}
|
|
}
|