TD allows negative line widths in ProjGroups

Discussions about the development of the TechDraw workbench
User avatar
uwestoehr
Posts: 1794
Joined: Sun Jan 27, 2019 3:21 am

TD allows negative line widths in ProjGroups

Postby uwestoehr » Fri Dec 06, 2019 11:55 pm

- in a projection view select e.g. the front view
- go to the View tab and there to the Lines section

result: the default line width is "0.7"

- now use the arrow button of the field to decrease the width

result: you end up with "-0.3"

So there are 2 bugs (applies for all widths):
- the width has no unit (I guess it is pt)
- the width can be negative
User avatar
wandererfan
Posts: 4078
Joined: Tue Nov 06, 2012 5:42 pm

Re: TD allows negative line widths in ProjGroups

Postby wandererfan » Sat Dec 07, 2019 1:17 am

uwestoehr wrote:
Fri Dec 06, 2019 11:55 pm
- the width has no unit (I guess it is pt)
- the width can be negative
Line width is mm. And of course it shouldn't be negative. Zero is actually ok - Qt interprets that as a "cosmetic line", very thin.

We should use PropertyLength for
App::PropertyFloat LineWidth;
App::PropertyFloat HiddenWidth;
App::PropertyFloat IsoWidth;
App::PropertyFloat ExtraWidth;
in ViewProviderViewPart.
User avatar
uwestoehr
Posts: 1794
Joined: Sun Jan 27, 2019 3:21 am

Re: TD allows negative line widths in ProjGroups

Postby uwestoehr » Sat Dec 07, 2019 2:43 am

wandererfan wrote:
Sat Dec 07, 2019 1:17 am
We should use PropertyLength for
App::PropertyFloat LineWidth;
App::PropertyFloat HiddenWidth;
App::PropertyFloat IsoWidth;
App::PropertyFloat ExtraWidth;
in ViewProviderViewPart.
I already wrote a patch accordingly ;-) I'll provide a PR hopefully tomorrow.
User avatar
uwestoehr
Posts: 1794
Joined: Sun Jan 27, 2019 3:21 am

Re: TD allows negative line widths in ProjGroups

Postby uwestoehr » Sat Dec 07, 2019 3:30 am

uwestoehr wrote:
Sat Dec 07, 2019 2:43 am
I already wrote a patch accordingly ;-) I'll provide a PR hopefully tomorrow.
Here it is: https://github.com/FreeCAD/FreeCAD/pull/2761