Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#682 closed defect (fixed)

DnD dosnt work properly when constrained to a node (patch attached - CLA is on file - file dnd/HtmlDragAndDrop.js).

Reported by: elricho66@… Owned by: bill
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: Cc: elricho66@…
Blocked By: Blocking:

Description (last modified by alex)

getConstraints assumed the constraining node was positioned at 0,0 ... When its not then the constraining box is not positioned correctly .. Here's a patch.

146d145
<                       screenPos = dojo.style.getAbsolutePosition(this.constrainingContainer, true);
150,153c149,152
<                       minX: padLeft + screenPos.x,
<                       minY: padTop + screenPos.y,
<                       maxX: padLeft+width - dojo.style.getOuterWidth(this.domNode) + screenPos.x,
<                       maxY: padTop+height - dojo.style.getOuterHeight(this.domNode) + screenPos.y
---
>                       minX: padLeft,
>                       minY: padTop,
>                       maxX: padLeft+width - dojo.style.getOuterWidth(this.domNode),
>                       maxY: padTop+height - dojo.style.getOuterHeight(this.domNode)

Attachments (3)

diff (1.2 KB) - added by anonymous 13 years ago.
diff.2 (1.2 KB) - added by anonymous 13 years ago.
test_container.html (3.6 KB) - added by elricho66@… 13 years ago.
Test cases for bug fixes

Download all attachments as: .zip

Change History (11)

comment:1 Changed 13 years ago by bill

Cc: elricho66@… added

Thanks for the patch. Please attach patches rather then putting them inline. Otherwise the formatting gets messed up.

Also, shouldn't the calculation for maxX/maxY reference padRight, padBottom?

Changed 13 years ago by anonymous

Attachment: diff added

Changed 13 years ago by anonymous

Attachment: diff.2 added

Changed 13 years ago by elricho66@…

Attachment: test_container.html added

Test cases for bug fixes

comment:2 Changed 13 years ago by elricho66@…

Err .. ignore that second patch bill .. sorry bout that :-)

padRight is calculated by padLeft + contentWidth .... so its taken care of .. Attached is a diff (against the original - not my first diff ..) & a test case for the nightly build ..

Cheers Richard

comment:3 Changed 13 years ago by bill

Richard - left and right padding are not necessarily the same. You need to look at the value of padding-right, not just padding-left. (Similary for padding-bottom)

comment:4 Changed 13 years ago by bill

Component: GeneralCore
Milestone: 0.3.1
Priority: highnormal

comment:5 Changed 13 years ago by alex

Description: modified (diff)

comment:6 Changed 13 years ago by alex

Owner: changed from anonymous to bill

comment:7 Changed 13 years ago by bill

Resolution: fixed
Status: newclosed

Fixed in [4166]

comment:8 Changed 12 years ago by (none)

Milestone: 0.3.1

Milestone 0.3.1 deleted

Note: See TracTickets for help on using tickets.