Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Changes to Edges introduced a defect #94

Open
bleibold opened this issue Mar 24, 2018 · 8 comments
Open

Latest Changes to Edges introduced a defect #94

bleibold opened this issue Mar 24, 2018 · 8 comments

Comments

@bleibold
Copy link
Contributor

The latest changes introduced a defect where a single standalone edge connector shape is being displayed once for each graph generation. I suspect the author of these changes will be able to quickly discover where this defect was introduced. If not, then please let me know so and I will research and fix.

This defect is reproducible in the WPF Show Case application.

image

@bleibold
Copy link
Contributor Author

Additional information: The Edge arrow that is defaulted to a canvas position of (0,0) happens to be an arrow on the single visible edge path that is supposed to be hidden (Invisible). If when the graph is generated this edge arrow that is shown at (0,0) was visible, then the edge would draw properly.

@bleibold
Copy link
Contributor Author

Defect appears to be fixed:

The following method in EdgeControlBase.cs was changed to fix this issue. There is a need to check the existing Visibility property, which may be set by a Binding and/or Converter.

    /// <summary>
    /// Internal. Update only edge points andge edge line visual
    /// </summary>
    /// <param name="updateLabel"></param>
    internal virtual void UpdateEdgeRendering(bool updateLabel = true)
    {
        if (!IsTemplateLoaded)
            ApplyTemplate();
        if (ShowArrows)
        {
            // Note: Do not override a possible WPF Binding or Converter for the Visibility property.
            if (EdgePointerForSource?.Visibility == Visibility.Visible)
                EdgePointerForSource?.Show();

            // Note: Do not override a possible WPF Binding or Converter for the Visibility property.
            if (EdgePointerForTarget?.Visibility == Visibility.Visible)
                EdgePointerForTarget?.Show();
        }
        else
        {
            EdgePointerForSource?.Hide();
            EdgePointerForTarget?.Hide();
        }
        PrepareEdgePath(true, null, updateLabel);
        if (LinePathObject == null) return;
        LinePathObject.Data = Linegeometry;
        LinePathObject.StrokeDashArray = StrokeDashArray;
    }

I have tested this and it appears to be a solid fix, but the author of the latest changes should review.

@bleibold
Copy link
Contributor Author

Requested 2 Pulls, but both failed through AppVeyor for unknown reason?

@panthernet
Copy link
Owner

Hi, thanks for the fix. The AppVeyor fails due to certificate error in UWP version and I don't know right now how to fix it.

@bleibold
Copy link
Contributor Author

bleibold commented Mar 25, 2018 via email

@bleibold
Copy link
Contributor Author

bleibold commented Mar 25, 2018 via email

@panthernet
Copy link
Owner

Hi, this is because edge can now have several labels attached both with their own visibility settings. Single edge or graphArea edge label visibility property would touch all the labels and it would be wrong logic here. Label visibility property along with some other abel properties has been moved to the label control itself so each of them can be controlled separately. Initial edge label visibility could be changed with methods, template or label factory. If you think that there is a better approach please let me know.

@bleibold
Copy link
Contributor Author

bleibold commented Mar 26, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants