PenWidth of GoShape not part of the shape?

Users of my GoView ask questions. Why GoObject like a GoDrawing cannot be selected when clicking on the border of the object when the border is wide (with PenWidth > 1). Also, why the object size and position do not change when the PenWidth change because the object seems bigger with a greater PenWidth.

You can reproduce easilly when you create a simple<span =“self”> Rectangle GoDrawing of 75 by 75 and play with the PenWidth, if you set it to 25 only the interior part of the border trigger a selection (the part which was in fact in the rectangle itself) and the size and position of the object was not reflected.

Can i avoid that? Users want to have the correct size and position including border and also trigger selection when a click was made on the exterior part of the border

I am using Version: 3.0.2.2

There seems to be a real issue here, I guess not many people have used GoDrawing with very wide PenWidths. For now, set PickMargin for the GoDrawing to be the same as PenWidth. See how that works for you.

PickMargin works as a workaround. When the object was alone the workaround works great. When user make group of GoDrawing object and others stuff more complicated the workaround not works :(.

PS: I think we will need to take in account the "PenWidth effect" on the object size and position in the future.

What’s the behavior in a group with “stuff more complicated”? Can you give me a sample that reproduces the issue?



re: penwidth and object size and position… no, that’s working as designed. There won’t be a change there.

Problems is user can make GoGroup of many GoDrawing, the GoDrawing in the GoGroup became unselectable in that case but GoGroup as whole is selectable. The GoGroup size and location was base on sums of GoDrawing size and location, meaning if GoDrawing with big PenWidth was on the edge of GoGroup the edge will not trigger selection event.

Also, like i said before, users find strange a GoDrawing object PenWidth was not take in account in the size and position of the object. Example: Users want an object to start at position (10,10) which is perfectly ok when PenWidth was 0, but when PenWidth is set to 20 the display of object start in fact at (0,0), the users seems to think it is incorrect because he expect the object display will start at (10,10) even with different PenWidth (Users think Location is the top-left corner of GoObject, so he expect the object cannot display at lower location than the GoObject.Location). The object display size is also bigger than the true GoObject.Size returned when PenWidth > 1. I understand this behavior is by design in GoDiagram and i will try to explain your behavior to my users. It is more easy to explain it now because i find others programs which have the same behavior than GoDiagram (like PowerPoint LineWidth which do not change object size and position too).

Try this setting PenAlignment… I think this gives you what you’re looking for:



GoDrawing stop = new GoDrawing(GoFigure.StopSign);

Pen p = new Pen(Color.Red, 20);

stop.PickMargin = 0;

p.Alignment = PenAlignment.Inset;

stop.Pen = p;

Perfect, seems the exact behavior my user want, thanks!