Page 1 of 1

[ANGULAR] Detect which side is used for Resize

Posted: Tue Aug 13, 2024 9:00 pm
by richard.schoeffauer

Hello Bryntum Team,

i am implementing the resize functionality for our events. Depending on which event-handle (left or right) the resizing is initiated with, different things should happen. However, i can not find a proper way to detect which handle is used for the resizing.

My work around so far is to check the "event.offsetX" (of the browser event, e.g. in the onBeforeEventResize) which gives me difference in pixels between the left edge of the actually rendered event and whereever my mouse position was when resize was initiated.

However, this workaround isn't really reliable regarding resolution and zoom changes.
Is there a proper way to detect, which handle the resizing was initiated with?


Re: [ANGULAR] Detect which side is used for Resize

Posted: Tue Aug 13, 2024 10:55 pm
by marcio

Hey richard,

Thanks for reaching out.

Currently, the way that you're using (calculating with offset) would be the indicated way. But I created a ticket to provide that info in the event data https://github.com/bryntum/support/issues/9810.


Re: [ANGULAR] Detect which side is used for Resize

Posted: Wed Aug 14, 2024 7:54 am
by richard.schoeffauer

Obrigado for the quick reply,

while the ticket is in progress, i guess using "event.target.offsetWidth" for the total width of the event and then calculating the distance to the middle of the rendered object makes this approach robust enough.