Bug Tracker

Opened 12 years ago

Closed 12 years ago

#2431 closed bug (fixed)

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

Reported by: jeffkretz Owned by: braeker
Priority: undecided Milestone: 1.2.4
Component: ui 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 (5)

comment:1 Changed 12 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 12 years ago by paul

need: ReviewPatch
Owner: changed from paul to rworth

comment:3 Changed 12 years ago by paul

Owner: changed from rworth to paul

comment:4 Changed 12 years ago by paul

Owner: changed from paul to braeker

comment:5 Changed 12 years ago by braeker

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.