lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
24 lines • 1.03 kB
JavaScript
import { PointerButtonEvent } from './PointerButtonEvent.js';
import { FocusType } from '../core/FocusType.js';
/**
* A pointer release {@link PointerButtonEvent} (pointer button up).
*
* Has a focus type of {@link FocusType.Pointer} and does not need focus.
*
* @category Event
*/
export class PointerReleaseEvent extends PointerButtonEvent {
constructor(x, y, button, shift, ctrl, alt, source, target = null) {
super(x, y, button, shift, ctrl, alt, source, target);
this.type = PointerReleaseEvent.type;
this.focusType = FocusType.Pointer;
}
correctOffset(xOffset, yOffset) {
return new PointerReleaseEvent(this.x - xOffset, this.y - yOffset, this.button, this.shift, this.ctrl, this.alt, this.source, this.target);
}
cloneWithTarget(target) {
return new PointerReleaseEvent(this.x, this.y, this.button, this.shift, this.ctrl, this.alt, this.source, target);
}
}
PointerReleaseEvent.type = 'pointer-release';
//# sourceMappingURL=PointerReleaseEvent.js.map