Page MenuHome

Snap Gizmo: Remove the use of the private header "wm.h"
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Nov 12 2020, 1:43 PM.

Details

Summary

As explained in rB80d6421f2847, wm.h should not be used in snap3d_gizmo.c.

However, since the snap gizmo is only drawn when it is highlighed (that is,
when it "can be selected" which is when a snap point is found), its drawing
depends a lot on the test_select callback.

But gizmo values can be updated "manually", either by properties or by
utility functions. In this case, the snap gizmo must be drawn to indicate
the new snap point.

This patch proposes draw gizmo only when the eventstate located in
wm->winactive->eventstate has not changed.

So it doesn't matter if it's "selected" or not.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 11238
Build 11238: arc lint + arc unit

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Nov 12 2020, 1:43 PM
Germano Cavalcante (mano-wii) planned changes to this revision.Nov 27 2020, 9:29 PM

Found a problem in the gizmo to add objects.

  • Redo the code to capture the eventstate

This seems fine, it also fixes: T83460, although this a regression which we might want to fix for 2.91 bugfix release.

This revision is now accepted and ready to land.Dec 9 2020, 5:13 AM

I looked for a separate solution to be backported, but since this one works and this gizmo is being used only by the measure tool in 2.90.1, I think we can use it.