Need help for issue with selection

Hi

We have use case where application reads proprietary format from the file and renders graphics using GoDiagram. There are cases where lines are thinner than 1 pixel. I’m using GoDrawing to draw lines and curves. The issue is when I set pen size less than 1 and also scale (DocScale) is reduced to be less than 1 at some point of time such lines cannot be selected using mouse. I could not determine exact combination of line width and document scale where GoDiagram stops selecting such lines but If I increase document scale, then at some point of time these lines (having pen size less than 1) starts getting selected.

Sample code is provide at the end of this post. Can you please help resolving this issue?

Thanks,
Tushar


If you try this, you can see that Black line cannot be selected

        goView1.DocScale = 0.25f;

        GoDrawing pGD1 = new GoDrawing();
        pGD1.PenColor = System.Drawing.Color.Black;
        pGD1.PenWidth = 0.25f;
        pGD1.StartAt(10, 10);
        pGD1.LineTo(10, 200);

        GoDrawing pGD2 = new GoDrawing();
        pGD2.PenColor = System.Drawing.Color.Red;
        pGD2.PenWidth = 0.5f;
        pGD2.StartAt(60, 10);
        pGD2.LineTo(60, 200);

        GoDrawing pGD3 = new GoDrawing();
        pGD3.PenColor = System.Drawing.Color.Green;
        pGD3.PenWidth = 1.0f;
        pGD3.StartAt(110, 10);
        pGD3.LineTo(110, 200);

        GoDrawing pGD4 = new GoDrawing();
        pGD4.PenColor = System.Drawing.Color.Blue;
        pGD4.PenWidth = 2.0f;
        pGD4.StartAt(160, 10);
        pGD4.LineTo(160, 200);

        goView1.Document.Add(pGD1);
        goView1.Document.Add(pGD2);
        goView1.Document.Add(pGD3);
        goView1.Document.Add(pGD4);

GoStroke has:

public virtual float PickMargin

the default is 3.

Thanks for the suggestion. Our current implementation uses GoDrawing and I have seen that PickMargin property is also exposed by the GoDrawing class, I have tried increasing PickMargin in above example but it did not give any different result.

Does PickMargin work only for the GoStroke?

No, GoDrawing does the same thing as GoStroke.

I have tried creating test application (see screen capture below) where I have drawn multiple lines with different pen width. What I have observed is that at 0.25 docscale I can always select Green lines but not any other lines. As I increase the docscale some of the lines can be selected, but I could not understand the pattern.

I have also tried setting PickMargin up to 10 but it did not make any difference. Lines I could not select before increasing PickMargin, are still not selectable after PickMargin is set to 10.

Any further suggestion or hint?

Can you email me your test app?

Test app emailed.

thanks. Checking it out now.

I’ve sent you a possible workaround. Let me know…