The MindFusion Forums
Flow Diagramming Components >> WPF >> Problem when resize multiple nodes
https://mindfusion.eu/Forum/YaBB.pl?num=1560431548

Message started by PDM on Jun 13th, 2019 at 1:12pm

Title: Problem when resize multiple nodes
Post by PDM on Jun 13th, 2019 at 1:12pm
Hello, I create multiple nodes on my diagram  example, just 2 custom nodes booth same size, then drag the mouse over the screen to select multiple nodes, when I resize the nodes dragging one of the handles, is supposed all nodes should end with same size.

I see after resize, some nodes end with different sizes, some are more big other a little but more big etc.
Some idea why this happen?

Title: Re: Problem when resize multiple nodes
Post by PDM on Jun 13th, 2019 at 1:19pm
Extra info, only happen if have enabled the ruler, the lane grid.

form.AutoAlignNodes = true;
form.AlignToGrid = false;

I think is some kind of bug.

Title: Re: Problem when resize multiple nodes
Post by Slavcho on Jun 14th, 2019 at 8:32am
Hi Pablo,

This build should fix it -
https://mindfusion.eu/_temp/wpfdiag355.zip

Regards,
Slavcho

Title: Re: Problem when resize multiple nodes
Post by PDM on Jun 15th, 2019 at 3:27pm
Thanks for the update, but no, no is fixed.
Now I check when resize multiple nodes  with ruler enabled, height is always ok after end of resize noded, but width of nodes always end with some pixels of difference.

Title: Re: Problem when resize multiple nodes
Post by Slavcho on Jun 17th, 2019 at 9:16am
Please verify your project loads the assemblies with v3.5.5 build number, or attach a test project reproducing that otherwise.

Title: Re: Problem when resize multiple nodes
Post by PDM on Jun 17th, 2019 at 12:43pm
ok, you are right ......incorrect version.
Now load correct assemblies, but have some errors.


private void form_HitTestAdjustmentHandles(object sender, HitTestEventArgs e)
        {
         
            var node = (DiagramNode)e.Item;
            node.HandlesStyle = HandlesStyle.EasyMove;

            int handle = -1;
           node.HitTestHandle(e.MousePosition, ref handle);  //**
            if (handle == -1 && node.ContainsPoint(e.MousePosition))
                handle = 8;
            e.HitResult = handle;  //*
            node.HandlesStyle = HandlesStyle.Custom;
            if (node.EnabledHandles == AdjustmentHandles.None)
            {
                node.HandlesStyle = HandlesStyle.SquareHandles2;
                node.EnabledHandles = AdjustmentHandles.None;

            }

        }


//**       No overload for method 'HitTestHandle' takes 2 arguments      Modular

//*  Cannot implicitly convert type 'int'


Title: Re: Problem when resize multiple nodes
Post by PDM on Jun 17th, 2019 at 2:08pm
var node = (DiagramNode)e.Item;
    node.HandlesStyle = HandlesStyle.EasyMove;
    e.HitResult = node.HitTestHandle(e.MousePosition);
    if (e.HitResult == null)
        e.HitResult = NodeAdjustmentHandle.Move;
    node.HandlesStyle = HandlesStyle.Custom;


You already replied ot me with a solution in other post  thanks.
Anyway, somehting is working wrong after this update.

I select a node, or multiple nodes, can resize, all is ok.
But when make click outside of the node, on the form screen, the node continue selected and the handle is there, have to make multiple clicks for make the object is unselected.

Before this udpoate a simple click or drag outisde of node delected the node.
I use thsi feature duet you cna drag outside and over nodes for select multiple nodes.


No idea what happen but now is broken and have to click multiple times outside of node in order handle dissapear.  I think is a new bug.


Title: Re: Problem when resize multiple nodes
Post by Slavcho on Jun 17th, 2019 at 2:18pm
My guess is this part always moves current selected node instead of deselecting -

[code]
if (e.HitResult == null)
    e.HitResult = NodeAdjustmentHandle.Move;[/code]

Remove that or otherwise check if the node contains the point before setting HitResult.

Title: Re: Problem when resize multiple nodes
Post by PDM on Jun 17th, 2019 at 2:34pm
Lol!!
as 99.99% of time............you are right lol

   if (e.HitResult == null)
                if (node.ContainsPoint(e.MousePosition) == true)
                e.HitResult = NodeAdjustmentHandle.Move;
                node.HandlesStyle = HandlesStyle.Custom;

Done fixed!!

Title: Re: Problem when resize multiple nodes
Post by PDM on Jun 17th, 2019 at 2:35pm
Again!! thanks for the faster fix of the bug when resize :)
Really appreciated!!

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.