RichTextAnnotation issues

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

RichTextAnnotation issues

Postby uwestoehr » Sat Jan 25, 2020 12:24 pm

I think there are some issues in the RichTextAnnotation feature:

stroke through items are meanwhile resolved

  • Create a new annotation and set the option "Show Frame". Select the annotation in the tree and go to the View properties tab. There change the color of the frame
    -> result: nothing happens
    select another element in the tree
    -> result: now the changed color is shown

    This bug also happens for Line Style and Line Width
  • Select the annotation in the tree and go to the View properties tab. The frame setting Line Style has numbers. But since this settings offers line styles, it should instead of a number be a combo box showing the different styles. The Leader Line dialog offers this in a basic form:
    LeaderLine-dialog.png
    Leader Line Dialog
    LeaderLine-dialog.png (11.54 KiB) Viewed 368 times
    This way it is assured that the user cannot e.g. enter "6" as there are only 5 styles available. -> one can now only set in the range 0 - 5
    Here is an example of how Inkscape does it using images:
    LineStylesInkscape.jpg
    screenshot from Inkscape
    LineStylesInkscape.jpg (127.03 KiB) Viewed 368 times
  • The Richt Text dialog has no settings for the frame line color/width and style like, The Leader Line Dialog has it -> I'll try to make PR.
  • The frame Line Width setting has no unit. It is millimeter -> I'll try to make a PR
  • Set the frame Line Width setting to e.g. "7".
    -> result: it looks ugly:
    FreeCAD_Fyi5kyVgis.png
    Line Width 7
    FreeCAD_Fyi5kyVgis.png (7.81 KiB) Viewed 368 times
  • Open the annotation dialog by double-clicking on the annotation in the tree. Remove there the frame option. Then close the dialog, select the annotation in the tree and go to the View properties tab.
    -> result: the 3 entries for the frame are enabled despite there is no frame. They should therefore be disabled.
  • I already reported the missing default text size issue here
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19363 (Git)
Build type: Release
Branch: master
Hash: e434d1145de6e964deca65698c4a162c331f52b5
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Last edited by uwestoehr on Wed Jan 29, 2020 11:01 pm, edited 1 time in total.
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: RichTextAnnotation issues

Postby uwestoehr » Sun Jan 26, 2020 1:58 am

uwestoehr wrote:
Sat Jan 25, 2020 12:24 pm
[*] Create a new annotation and set the option "Show Frame". Select the annotation in the tree and go to the View properties tab. There change the color of the frame
-> result: nothing happens
This PR fixes it: https://github.com/FreeCAD/FreeCAD/pull/2939
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: RichTextAnnotation issues

Postby uwestoehr » Sun Jan 26, 2020 3:39 pm

uwestoehr wrote:
Sat Jan 25, 2020 12:24 pm
[*] The frame Line Width setting has no unit. It is millimeter -> I'll try to make a PR
This PR adds this for all LineWidth occurrences in TD: https://github.com/FreeCAD/FreeCAD/pull/2942
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: RichTextAnnotation issues

Postby uwestoehr » Sun Jan 26, 2020 5:16 pm

uwestoehr wrote:
Sat Jan 25, 2020 12:24 pm
The frame setting Line Style has numbers....
At the moment the user can there enter e.g. "6" but there are only 5 styles available.
This is fixed by the PR: https://github.com/FreeCAD/FreeCAD/pull/2942
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: RichTextAnnotation issues

Postby wandererfan » Sun Jan 26, 2020 7:54 pm

uwestoehr wrote:
Sun Jan 26, 2020 1:58 am
[*] Create a new annotation and set the option "Show Frame". Select the annotation in the tree and go to the View properties tab. There change the color of the frame
-> result: nothing happens

This PR fixes it: https://github.com/FreeCAD/FreeCAD/pull/2939
This fixes it without the extra repainting of calling "updateGraphic" twice for the 3 RTA ViewProvider properties and once for every ancestor VP property.

Code: Select all

@@ -124,6 +124,15 @@ void ViewProviderRichAnno::updateData(const App::Property* p)
 
 void ViewProviderRichAnno::onChanged(const App::Property* p)
 {
+    if ((p == &LineColor) ||
+        (p == &LineWidth) ||
+        (p == &LineStyle)) {
+        QGIView* qgiv = getQView();
+        if (qgiv) {
+            qgiv->updateView(true);
+        }
+    }
+
     ViewProviderDrawingView::onChanged(p);
 }
 
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: RichTextAnnotation issues

Postby uwestoehr » Sun Jan 26, 2020 10:06 pm

wandererfan wrote:
Sun Jan 26, 2020 7:54 pm
This fixes it without the extra repainting of calling "updateGraphic" twice for the 3 RTA ViewProvider properties and once for every ancestor VP property.
I don't understand because this is exactly what the new void updateGraphic() does.
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: RichTextAnnotation issues

Postby wandererfan » Mon Jan 27, 2020 12:54 am

uwestoehr wrote:
Sun Jan 26, 2020 10:06 pm
I don't understand because this is exactly what the new void updateGraphic() does.
This way is consistent with the other ViewProviders and only repaints on changes to interesting properties.
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: RichTextAnnotation issues

Postby uwestoehr » Mon Jan 27, 2020 9:41 am

wandererfan wrote:
Mon Jan 27, 2020 12:54 am
This way is consistent with the other ViewProviders and only repaints on changes to interesting properties.
OK. Then please close my PR and do it consistently. Or should I do this?
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: RichTextAnnotation issues

Postby wandererfan » Mon Jan 27, 2020 1:24 pm

uwestoehr wrote:
Mon Jan 27, 2020 9:41 am
OK. Then please close my PR and do it consistently. Or should I do this?
I've got this one, thanks.
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: RichTextAnnotation issues

Postby uwestoehr » Mon Jan 27, 2020 1:58 pm

wandererfan wrote:
Mon Jan 27, 2020 1:24 pm
I've got this one, thanks.
Thanks. I close my PR now.