Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#2431 closed bug (fixed)

Touch tolerance breaks when the draggable is taller than the droppable.

Reported by: jeffkretz Owned by: eduardo
Priority: blocker Milestone: 1.5
Component: ui.core Version: 1.2.3
Keywords: tolerance Cc:
Blocked by: Blocking:

Description

See demo page at:

http://cobalt.scorpiontechnology.com/Test/HTMLPage.htm

Only the top and bottom edges of the draggable activate the droppable. When the draggable is centered over the droppable, it cannot be dropped.

JK

Change History (7)

comment:1 Changed 15 years ago by jeffkretz

In stepping through the code, I see that the logic only detects for the presence of one corner inside another. So when the draggable is larger, it can overlap yet have no corner inside. This change solved the problem for me:

case 'touch':
	return ( (y1 >= t && y1 <= b) ||	// Top edge touching	
		 (y2 >= t && y2 <= b) ||	// Bottom edge touching	
		 (y1 < t && y2 > b)		// Surrounded vertically	
		) && (
		 (x1 >= l && x1 <= r) ||	// Left edge touching	
		 (x2 >= l && x2 <= r) ||	// Right edge touching	
		 (x1 < l && x2 > r)		// Surrounded horizontally
		);

You can see this working at:

http://cobalt.scorpiontechnology.com/Test/HTMLPage2.htm

JK

comment:2 Changed 15 years ago by paul

need: ReviewPatch
Owner: changed from paul to rworth

comment:3 Changed 15 years ago by paul

Owner: changed from rworth to paul

comment:4 Changed 15 years ago by paul

Owner: changed from paul to braeker

comment:5 Changed 15 years ago by braeker

Resolution: fixed
Status: newclosed

comment:6 Changed 15 years ago by (none)

Milestone: 1.2.4

Milestone 1.2.4 deleted

comment:7 Changed 14 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.