| Project: | Draw2D |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
It seems as though there is a miscalculation when the workflow checks click coordinates against the position of its Lines when there is scroll applied on an element that is a parent of the workflow element.
I believe this problem originates in the mouseDown function of the workflow class:
var mouseDown = function()
{
var oEvent = arguments[0] || window.event;
var diffX = oEvent.clientX;// - oThis.html.offsetLeft;
var diffY = oEvent.clientY;// - oThis.html.offsetTop;
var scrollLeft = oThis.getScrollLeft();
var scrollTop = oThis.getScrollTop();
var xOffset = oThis.getAbsoluteX();
var yOffset = oThis.getAbsoluteY();
oThis.onMouseDown(diffX+scrollLeft-xOffset, diffY+scrollTop-yOffset);
}
From my investigation, the getScrollLeft() & getScrollTop() methods do not take into consideration the scroll value of parent elements of the workflow, which in turn effects the selection of lines in the workflow. I was able to fix this by overriding these methods to return absolute scroll values, based on the cumulative scroll of all parent elements, however I'm not sure how appropriate this is as a fix as I don't understand the root of the problem 100%.