Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Grid zooming causes bizare look (Read 5560 times)
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Grid zooming causes bizare look
Mar 9th, 2017 at 10:15am
Print Post  
There is a problem with grid when zooming. This problem occurs not every time, but quite often.
After zooming grid looks like that
http://i65.tinypic.com/28h26ue.jpg

Is it possible somehow solve this problem?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Grid zooming causes bizare look
Reply #1 - Mar 9th, 2017 at 5:12pm
Print Post  
Please check if this build fixes it -
https://mindfusion.eu/_beta/jsdiag_gridzoom.zip
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: Grid zooming causes bizare look
Reply #2 - Mar 10th, 2017 at 7:11am
Print Post  
I think your biuld fixed problem with zooming, but i found another one. I have JS function
Code (Javascript)
Select All
function diagramView_OnNodeMove(sender, args) {

    var margin = nodePosition.width;

    const increment = 25;
    var bounds = getDiagramBounds();
    var left = bounds.left()
    var right = bounds.right();
    var top = bounds.top();
    var bottom = bounds.bottom();

    if (nodePosition.x <= left) {
        left -= increment;
        setDiagramBounds(left, top, right, bottom);
    }
    else if (nodePosition.x >= right - margin) {
        right += increment;
        setDiagramBounds(left, top, right, bottom);
    }
    else if (nodePosition.y <= top) {
        top -= increment;
        setDiagramBounds(left, top, right, bottom);
    }
    else if (nodePosition.y >= bottom - margin) {
        bottom += increment;
        setDiagramBounds(left, top, right, bottom);
    }
}

function setDiagramBounds(left, top, right, bottom) {
    var diagram = getDiagram();
    var rect = MindFusion.Drawing.Rect;
    var newBoundsRect = rect.fromLTRB(left, top, right, bottom);
    diagram.setBounds(newBoundsRect);
}
 



So, after moving node over the edge (left and top) this bug occurs.

http://i65.tinypic.com/308xudk.jpg
http://i63.tinypic.com/8z18q9.jpg
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Grid zooming causes bizare look
Reply #3 - Mar 10th, 2017 at 2:21pm
Print Post  
Is that a handler for NodeModified event, and where does nodePosition come from? I think you are trying to implement what the built-in AutoResize property does - try setting it to AllDirections and see if it will work for you.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: Grid zooming causes bizare look
Reply #4 - Mar 13th, 2017 at 6:54am
Print Post  
Yep, it is a handler for NodeModifyingScript event.
Code (Javascript)
Select All
var nodePosition = args.node.getBounds(); 



I tried to use AutoResize="AllDirections" but it didn't work for me properly. Some times it's working, sometime it's not. And it also has problems with grid. Some lines even disappeared.

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Grid zooming causes bizare look
Reply #5 - Mar 13th, 2017 at 8:53am
Print Post  
Vertical grid lines stop drawing when they reach right diagram boundary, and horizontal lines stop drawing when they reach bottom boundary. Have you disabled your NodeModified handler when trying AutoResize, so we know whether to look for the problem in the AutoResize code or in your OnNodeMove function?
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: Grid zooming causes bizare look
Reply #6 - Mar 13th, 2017 at 9:59am
Print Post  
Yes, I disabled NodeModified handler
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Grid zooming causes bizare look
Reply #7 - Mar 13th, 2017 at 6:04pm
Print Post  
Please let me know what we should change in attached test project to reproduce - try copying your settings and event handlers until that happens.

Regards,
Slavcho
  

TestAutoResize.zip ( 254 KB | 185 Downloads )
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: Grid zooming causes bizare look
Reply #8 - Mar 14th, 2017 at 8:18am
Print Post  
Well, we are using .aspx, so I found it problematic to reproduce this bug on test project.

Code
Select All
<%@ Register TagPrefix="ndiag" Namespace="MindFusion.Diagramming.WebForms" Assembly="MindFusion.Diagramming.WebForms" %>
...
<td id="diagram_window" class="diagramWindowCell resizable">
<ndiag:DiagramView ID="diagramView"runat="server" Behavior="DrawLinks" ClientSideMode="Canvas" EnableItemsDOM="true" AllowInplaceEdit="false"  JsLibraryLocation="../../Scripts/MindFusion/MindFusion.Diagramming.js"         ShapeLibraryLocation="~/Workflow/Designer/ShapeLibrary/DlxCustomShapeLibrary.xml"                             NodeDoubleClickedScript="onNodeDoubleClicked"
NodeCreatingScript="onNodeCreating" NodeCreatedScript="onNodeCreated" NodeSelectedScript="diagramView_OnNodeSelected" NodeDeselectedScript="diagramView_OnNodeDeselection"
LinkCreatingScript ="diagramView_onLinkCreating">
<Diagram RouteLinks="true" GridStyle="Lines" AlignToGrid="True" ShowGrid="True" GridColor="#1B000000" GridSizeY="10" GridSizeX="10"
AdjustmentHandlesSize="8" LinkCrossings="Arcs" HitTestPriority="ZOrder" AllowUnconnectedLinks="false" AutoResize="AllDirections">
</Diagram>
</ndiag:DiagramView>
</td>
...
 



Maybe I should have create this topic in ASP.NET section.
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: Grid zooming causes bizare look
Reply #9 - Mar 14th, 2017 at 10:26am
Print Post  
Hi. I have found another problem - then I creating new diagram and drop node on the edge from nodelist, diagram is automatically resized.

But after I save diagram and put another shape node from nodelist on the edge, autoresizing is not working and shape is looking cropped
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Grid zooming causes bizare look
Reply #10 - Mar 14th, 2017 at 10:43am
Print Post  
Do you mean after loading a diagram file from client side? That will get fixed when we complete JavaScript XML serialization code of diagram properties we discussed earlier. We should have it ready in a few days, until then you can save and load XML from server-side to make sure nothing is missing.
  
Back to top
 
IP Logged
 
friedel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 31
Joined: Mar 3rd, 2017
Re: Grid zooming causes bizare look
Reply #11 - Mar 14th, 2017 at 11:01am
Print Post  
Ok, I will wait for fix.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint