mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-10-24 11:43:07 +02:00
15 lines
521 B
TypeScript
15 lines
521 B
TypeScript
import { NitroToolbarAnimateIconEvent } from '@nitrots/nitro-renderer';
|
|
import { GetRoomEngine } from '../../api';
|
|
|
|
export const CreateTransitionToIcon = (image: HTMLImageElement, fromElement: HTMLElement, icon: string) =>
|
|
{
|
|
const bounds = fromElement.getBoundingClientRect();
|
|
const x = (bounds.x + (bounds.width / 2));
|
|
const y = (bounds.y + (bounds.height / 2));
|
|
const event = new NitroToolbarAnimateIconEvent(image, x, y);
|
|
|
|
event.iconName = icon;
|
|
|
|
GetRoomEngine().events.dispatchEvent(event);
|
|
}
|