Cleanup: ui-link drawing code from logic bricks
This commit is contained in:
parent
5eb20bd152
commit
e597f7495a
|
@ -179,7 +179,7 @@ enum {
|
|||
UI_BUT_COLOR_CUBIC = (1 << 23), /* cubic saturation for the color wheel */
|
||||
UI_BUT_LIST_ITEM = (1 << 24), /* This but is "inside" a list item (currently used to change theme colors). */
|
||||
UI_BUT_DRAG_MULTI = (1 << 25), /* edit this button as well as the active button (not just dragging) */
|
||||
UI_BUT_SCA_LINK_GREY = (1 << 26), /* used to flag if sca links shoud be gray out */
|
||||
|
||||
UI_BUT_HAS_SEP_CHAR = (1 << 27), /* but->str contains UI_SEP_CHAR, used for key shortcuts */
|
||||
UI_BUT_UPDATE_DELAY = (1 << 28), /* don't run updates while dragging (needed in rare cases). */
|
||||
UI_BUT_TEXTEDIT_UPDATE = (1 << 29), /* when widget is in textedit mode, update value on each char stroke */
|
||||
|
|
|
@ -608,8 +608,6 @@ static bool ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBu
|
|||
but->selend = oldbut->selend;
|
||||
but->softmin = oldbut->softmin;
|
||||
but->softmax = oldbut->softmax;
|
||||
but->linkto[0] = oldbut->linkto[0];
|
||||
but->linkto[1] = oldbut->linkto[1];
|
||||
oldbut->active = NULL;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -188,23 +188,6 @@ enum {
|
|||
/* max amount of items a radial menu (pie menu) can contain */
|
||||
#define PIE_MAX_ITEMS 8
|
||||
|
||||
typedef struct uiLinkLine { /* only for draw/edit */
|
||||
struct uiLinkLine *next, *prev;
|
||||
struct uiBut *from, *to;
|
||||
short flag, deactive;
|
||||
} uiLinkLine;
|
||||
|
||||
typedef struct {
|
||||
void **poin; /* pointer to original pointer */
|
||||
void ***ppoin; /* pointer to original pointer-array */
|
||||
short *totlink; /* if pointer-array, here is the total */
|
||||
|
||||
short maxlink, pad;
|
||||
short fromcode, tocode;
|
||||
|
||||
ListBase lines;
|
||||
} uiLink;
|
||||
|
||||
struct uiBut {
|
||||
struct uiBut *next, *prev;
|
||||
int flag, drawflag;
|
||||
|
@ -738,8 +721,6 @@ void ui_draw_pie_center(uiBlock *block);
|
|||
uiWidgetColors *ui_tooltip_get_theme(void);
|
||||
void ui_draw_tooltip_background(uiStyle *UNUSED(style), uiBlock *block, rcti *rect);
|
||||
void ui_draw_search_back(struct uiStyle *style, uiBlock *block, rcti *rect);
|
||||
bool ui_link_bezier_points(const rcti *rect, float coord_array[][2], int resol);
|
||||
void ui_draw_link_bezier(const rcti *rect, const float color[4]);
|
||||
|
||||
extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *style, uiBut *but, rcti *rect);
|
||||
/* theme color init */
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_curve.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
||||
|
@ -3154,30 +3153,6 @@ static void widget_numbut_embossn(uiBut *UNUSED(but), uiWidgetColors *wcol, rcti
|
|||
widget_numbut_draw(wcol, rect, state, roundboxalign, true);
|
||||
}
|
||||
|
||||
bool ui_link_bezier_points(const rcti *rect, float coord_array[][2], int resol)
|
||||
{
|
||||
float dist, vec[4][2];
|
||||
|
||||
vec[0][0] = rect->xmin;
|
||||
vec[0][1] = rect->ymin;
|
||||
vec[3][0] = rect->xmax;
|
||||
vec[3][1] = rect->ymax;
|
||||
|
||||
dist = 0.5f * fabsf(vec[0][0] - vec[3][0]);
|
||||
|
||||
vec[1][0] = vec[0][0] + dist;
|
||||
vec[1][1] = vec[0][1];
|
||||
|
||||
vec[2][0] = vec[3][0] - dist;
|
||||
vec[2][1] = vec[3][1];
|
||||
|
||||
BKE_curve_forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], &coord_array[0][0], resol, sizeof(float[2]));
|
||||
BKE_curve_forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], &coord_array[0][1], resol, sizeof(float[2]));
|
||||
|
||||
/* TODO: why return anything if always true? */
|
||||
return true;
|
||||
}
|
||||
|
||||
/* function in use for buttons and for view2d sliders */
|
||||
void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue