index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
3 changed files with 8 additions and 4 deletions
Showing only changes of commit 7cc7cd0e80 - Show all commits

View File

@ -53,8 +53,9 @@ typedef struct EditFont {
int selstart, selend; int selstart, selend;
/** /**
* Combined styles (#CharInfo.flag) for selected string. A flag will be * Combined styles from #CharInfo.flag for the selected range selected
* set only if ALL characters in the selected string have it. * (only including values from #CU_CHINFO_STYLE_ALL).
* A flag will be set only if ALL characters in the selected string have it.
*/ */
int select_char_info_flag; int select_char_info_flag;

View File

@ -1143,8 +1143,7 @@ static bool vfont_to_curve(Object *ob,
if (ef && ef->selboxes) { if (ef && ef->selboxes) {
/* Set combined style flags for the selected string. Start with all styles then /* Set combined style flags for the selected string. Start with all styles then
* remove one if ANY characters do not have it. Break out if we've removed them all. */ * remove one if ANY characters do not have it. Break out if we've removed them all. */
ef->select_char_info_flag = CU_CHINFO_BOLD | CU_CHINFO_ITALIC | CU_CHINFO_UNDERLINE | ef->select_char_info_flag = CU_CHINFO_STYLE_ALL;
CU_CHINFO_SMALLCAPS;
for (int k = selstart; k <= selend && ef->select_char_info_flag; k++) { for (int k = selstart; k <= selend && ef->select_char_info_flag; k++) {
info = &custrinfo[k]; info = &custrinfo[k];
ef->select_char_info_flag &= info->flag; ef->select_char_info_flag &= info->flag;

View File

@ -602,6 +602,10 @@ enum {
CU_CHINFO_OVERFLOW = 1 << 6, CU_CHINFO_OVERFLOW = 1 << 6,
}; };
/** User adjustable as styles (not relating to run-time layout calculation). */
#define CU_CHINFO_STYLE_ALL \
(CU_CHINFO_BOLD | CU_CHINFO_ITALIC | CU_CHINFO_UNDERLINE | CU_CHINFO_SMALLCAPS)
/* mixed with KEY_LINEAR but define here since only curve supports */ /* mixed with KEY_LINEAR but define here since only curve supports */
#define KEY_CU_EASE 3 #define KEY_CU_EASE 3