diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-11-19 14:32:21 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-11-19 14:32:21 +0300 |
commit | 36f18cd35c40eb5f6e6fc03c4f53dd02ee179b5c (patch) | |
tree | 047ee8ae5e8a667733d4a499c550ecfc8016a80d /source/blender/windowmanager/wm.h | |
parent | d7fa0fcaae139f0e24e9682d3ae4be0f242250ac (diff) |
Arrow widget interaction:
Fix interaction when pivot is beside the camera. basically we now do all
calculations in 3D space and we do not scale correct the offset in 3D -
this creates a nasty dependency loop between drawing and calculation for
widgets bound to properties - ie offset depends on scale but scale
depends on screen position - ie offset.
Also added an extra callback to get the final position of the widget in
3d space and use that to calculate the scale. This takes care of
bringing a close to the camera widget to the background and the widget
keeping its initial size. The final position can be different from the
initial position, especially when the widget is offset from the original
position.
Diffstat (limited to 'source/blender/windowmanager/wm.h')
-rw-r--r-- | source/blender/windowmanager/wm.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h index e5c5019814f..656e4016832 100644 --- a/source/blender/windowmanager/wm.h +++ b/source/blender/windowmanager/wm.h @@ -72,12 +72,16 @@ typedef struct wmWidget { /* widget-specific handler to update widget attributes when a property is bound */ void (*bind_to_prop)(struct wmWidget *widget); + /* returns the final position which may be different from the origin, depending on the widget. + * used in calculations of scale */ + void (*get_final_position)(struct wmWidget *widget, float vec[3]); + int flag; /* flags set by drawing and interaction, such as highlighting */ /* activate a widget state when the user clicks on it */ int (*activate_state)(struct bContext *C, const struct wmEvent *event, struct wmWidget *widget, int state); - /* position in space, 2d or 3d */ + /* center of widget in space, 2d or 3d */ float origin[3]; /* runtime property, set the scale while drawing on the viewport */ |