Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Wrong node selection location in in Google Chrome (Read 3470 times)
Blue
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 11th, 2014
Wrong node selection location in in Google Chrome
Jun 11th, 2014 at 9:30am
Print Post  
i'm using Diagramming for ASP.NET, V5.0.5

Somehow the location of click events in my diagram seems to get translated in the y-axis based on the amount of pixels the browser has scrolled down (eg. window.pageYOffset).

The effect of this is that nodes are selected when I click under them...

I need a fast fix or workaround for this as my customer only uses chrome.

Iv'e tried to hijack the canvas element click event to translate the event object but to no avail.

This happens in chrome, not in IE.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrong node selection location in in Google Chrome
Reply #1 - Jun 11th, 2014 at 10:14am
Print Post  
I could not reproduce that in Chrome with the samples from http://www.mindfusion.co/demos/index.html?Control=Diagramming

Can you see offset there with your Chrome version? Are you creating the diagram inside some container control?
  
Back to top
 
IP Logged
 
Blue
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 11th, 2014
Re: Wrong node selection location in in Google Chrome
Reply #2 - Jun 11th, 2014 at 11:12am
Print Post  
Hi, thanks for the fast response. If I use the demo page without frames I can reproduce the problem in chrome.

eg.
http://www.mindfusion.co/demos/Diagramming/Flowcharter/Default.aspx
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrong node selection location in in Google Chrome
Reply #3 - Jun 11th, 2014 at 12:37pm
Print Post  
We have some work-around for a Chrome-related bug in older MicrosoftAjax.js versions, which now seems fixed in MS Ajax 4, and our work-around only adds extra offset if you use ASP.NET 4. You could remove the ScriptManager from your page if you don't need it for anything else, and explicitly load MicrosoftAjax.js v3.5 to fix the offsets. Our developer will check later today if it will work better with MS Ajax 4 when the work-around is removed.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrong node selection location in in Google Chrome
Reply #4 - Jun 11th, 2014 at 12:47pm
Print Post  
Run this code after loading MindFusion.Diagramming.js and clicks should work correctly with latest MicrosoftAjax.js:

Code
Select All
MindFusion.Diagramming.Utils.getBounds = function (element)
{
    return Sys.UI.DomElement.getBounds(element);
};

MindFusion.Diagramming.Utils.getCursorPos = function (e, element)
{
    var scroll = MindFusion.Diagramming.Utils.getPageScroll();
    var bounds = Sys.UI.DomElement.getBounds(element);
    var x = e.clientX - bounds.x + scroll.scrollLeft;
    var y = e.clientY - bounds.y + scroll.scrollTop;
    return new MindFusion.Drawing.Point(x, y);
}; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Blue
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 11th, 2014
Re: Wrong node selection location in in Google Chrome
Reply #5 - Jun 11th, 2014 at 4:01pm
Print Post  
Thanks for the fix! It worked perfectly!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint