Position of Annotation not recomputed

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 54150
Joined: Tue Mar 17, 2015 9:14 am

Position of Annotation not recomputed

Post by chrisb »

In the attached model is the position of the annotation defined by expressions, which make it move together with the view. However, if the view is moved, no recompute is triggered and the annotation is not flagged for recompute. A manual recompute works.

To reproduce:
- Open the file
- Move View with the mouse

-> It needs a manual recompute of Annotation to reposition it.
Attachments
AnnotationPositionExpression.FCStd
(4.97 KiB) Downloaded 39 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9545
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Position of Annotation not recomputed

Post by Shalmeneser »

A TechDraw_RedrawPage is not enough. A recompute is needed.

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28717 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: French/France (fr_FR)
Installed mods: 
  * fasteners 0.3.40
  * Manipulator 1.4.3
  * sheetmetal 0.2.49
User avatar
ragohix769
Posts: 568
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Position of Annotation not recomputed

Post by ragohix769 »

I confirm.

It needs the total selection to re-compute, and then re-compute manually, redraw it's not working.

Code: Select all

OS: Ubuntu 20.04.4 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: fe5ac277a017413a8646b621d5b993b0c606d551
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, OCC 7.5.2
Locale: Italian/Italy (it_IT)
Installed mods: 
  * BIM 2021.12.0
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
User avatar
wandererfan
Veteran
Posts: 6308
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Position of Annotation not recomputed

Post by wandererfan »

chrisb wrote: Sun May 01, 2022 9:07 pm However, if the view is moved, no recompute is triggered and the annotation is not flagged for recompute.
I can change the code so Annotation is "touched" and the recompute button is enabled, but I can't get Annotation to recompute automatically.

Is the expected behaviour that Annotation be recomputed automatically or is having to push the recompute button normal?
User avatar
wandererfan
Veteran
Posts: 6308
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Position of Annotation not recomputed

Post by wandererfan »

Shalmeneser wrote: Mon May 02, 2022 9:32 am A TechDraw_RedrawPage is not enough. A recompute is needed.
Redraw updates the graphics with the current state of the objects. In this case, the Annotation object needs to update itself with the result of the expression.
chrisb
Veteran
Posts: 54150
Joined: Tue Mar 17, 2015 9:14 am

Re: Position of Annotation not recomputed

Post by chrisb »

wandererfan wrote: Mon May 02, 2022 3:42 pm Is the expected behaviour that Annotation be recomputed automatically or is having to push the recompute button normal?
Automatic recompute is not needed, perhaps even not desired, because of other time consuming stuff. Just flagging for recompute would fit well to other TechDraw things, which don't do the recompute immediately.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6308
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Position of Annotation not recomputed

Post by wandererfan »

Should be fixed by git commit ccc8ac65c5.
chrisb
Veteran
Posts: 54150
Joined: Tue Mar 17, 2015 9:14 am

Re: Position of Annotation not recomputed

Post by chrisb »

wandererfan wrote: Mon May 02, 2022 9:54 pm Should be fixed
Thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6308
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Position of Annotation not recomputed

Post by wandererfan »

I'm going to revert this change. It is causing issues with unnecessary recomputes and redraws for linked Views such as Details and Sections.

We look at this again in the v0.21 cycle. Created issue #6943 so we don't forget.
user1234
Veteran
Posts: 3475
Joined: Mon Jul 11, 2016 5:08 pm

Re: Position of Annotation not recomputed

Post by user1234 »

The CI from the PR#6942 (https://github.com/FreeCAD/FreeCAD/pull/6942) seems to stuck. Compiles fine here. Also the recomputing issue is gone. As expected the annotation recompute bug is risen again.

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.20.28951 (Git)
Build type: Release
Branch: fixDoubleDraw
Hash: 91baa16c9bc148c8862e148efb8b20c3de4d756b
Python 3.9.2, Qt 5.15.2, Coin 4.0.0, OCC 7.6.2
Locale: English/United States (en_US)
Greetings
user1234
Post Reply