Files
ueblueprint/js/template/ColorSliderTemplate.js
barsdeveloper 7469d55518 Replace parsing and test libraries
* WIP

* WIP

* wip

* WIP

* Several fixes

* Tests wip port to playwright

* WIP

* Fix more tests

* Serialization tests fixed

* Several fixes for tests

* Input options types

* Type adjustments

* Fix object reference parser

* Tests fixes

* More tests fixes
2024-02-14 00:40:42 +01:00

19 lines
643 B
JavaScript
Executable File

import IDraggableControlTemplate from "./IDraggableControlTemplate.js"
import Utility from "../Utility.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]
}
}