Page MenuHome

Object add align to cursor
AbandonedPublic

Authored by Benjamin Sauder (kioku) on Apr 4 2019, 9:17 PM.

Details

Summary

This patch tries to implement support for the cursor orientation on object creation.

Instead of a single toggle with the view_align property, I have added an enum propery which holds the cursor as well.
So, now the user can choose between the Global/View/Cursor options.

I left the view_align property alive, and made it so that it just sets the enum property - doing so should keep the python api untouched. None
the less it's a bit ugly to have two sameish options in there.. not sure what to do about it.

To my surprise much of this is implemented a second time in python. After looking a bit into it, it seems like it needs similar changes like on the C side. Probably best adressed in a different patch.

Notes:
in the original source there is this block on line 361:

*is_view_aligned = (U.flag & USER_ADD_VIEWALIGNED) != 0;

I did not understand what this is doing, so this surely needs someone to check.

Diff Detail

Event Timeline

I just saw this, I'm sorry I duplicated some of your work. This is a popular issue I think :P

I believe D4706 is a bit farther along than this, although I like that you used the icons, it looks good.

*is_view_aligned = (U.flag & USER_ADD_VIEWALIGNED) != 0;

This line's purpose is to grab the "Align new objects to the view" preference in the "Editing" tab of the preferences.

Ah thanks, makes senses, completely forgot about that option.

I'll abandon this for now, as the other diff does the same, and more with the python updates.