Improves event resizing with smooth animation
Replaces the previous rough event resizing implementation with a smooth, animated approach. Uses pointer events for accurate tracking and adds a visual resize handle for better user interaction. Also refactors drag and drop to exclude resize handle.
This commit is contained in:
parent
ce0a9b19eb
commit
1e5b3166b2
4 changed files with 420 additions and 230 deletions
|
|
@ -180,18 +180,11 @@ export class DragDropManager {
|
|||
}
|
||||
|
||||
|
||||
// Found an event - check if in resize zone first
|
||||
// Found an event - check if clicking on resize handle first
|
||||
if (eventElement) {
|
||||
// Check if click is in bottom resize zone
|
||||
if (eventElement.tagName === 'SWP-EVENT') {
|
||||
const rect = eventElement.getBoundingClientRect();
|
||||
const mouseY = event.clientY;
|
||||
const distanceFromBottom = rect.bottom - mouseY;
|
||||
const resizeZoneHeight = 15; // Match ResizeHandleManager
|
||||
// If in resize zone, don't handle this - let ResizeHandleManager take over
|
||||
if (distanceFromBottom >= 0 && distanceFromBottom <= resizeZoneHeight) {
|
||||
return; // Exit early - this is a resize operation
|
||||
}
|
||||
// Check if click is on resize handle
|
||||
if (target.closest('swp-resize-handle')) {
|
||||
return; // Exit early - this is a resize operation, let ResizeHandleManager handle it
|
||||
}
|
||||
// Normal drag - prepare for potential dragging
|
||||
this.draggedElement = eventElement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue