Cleanup: Remove unused View2D variables and function

It looks like this code was left over from tabbed panels in the
properties editor. It wasn't used anywhere except for in one line of
the horizontally-aligned panel code that was recently removed.

Differential Revision: https://developer.blender.org/D8651
This commit is contained in:
Hans Goudey 2020-09-30 12:21:35 -05:00
parent 65e4bfe2f0
commit 8cbd09672d
5 changed files with 0 additions and 69 deletions

View File

@ -435,10 +435,6 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *region)
}
}
if (region->v2d.tab_offset) {
newar->v2d.tab_offset = MEM_dupallocN(region->v2d.tab_offset);
}
panel_list_copy(&newar->panels, &region->panels);
BLI_listbase_clear(&newar->ui_previews);
@ -623,11 +619,6 @@ void BKE_area_region_free(SpaceType *st, ARegion *region)
region->type->free(region);
}
if (region->v2d.tab_offset) {
MEM_freeN(region->v2d.tab_offset);
region->v2d.tab_offset = NULL;
}
BKE_area_region_panels_free(&region->panels);
for (uilst = region->ui_lists.first; uilst; uilst = uilst->next) {

View File

@ -4974,9 +4974,6 @@ static void direct_link_region(BlendDataReader *reader, ARegion *region, int spa
}
}
region->v2d.tab_offset = NULL;
region->v2d.tab_num = 0;
region->v2d.tab_cur = 0;
region->v2d.sms = NULL;
region->v2d.alpha_hor = region->v2d.alpha_vert = 255; /* visible by default */
BLI_listbase_clear(&region->panels_category);

View File

@ -131,9 +131,6 @@ void UI_view2d_totRect_set_resize(struct View2D *v2d, int width, int height, boo
void UI_view2d_mask_from_win(const struct View2D *v2d, struct rcti *r_mask);
/* per tab offsets, returns 1 if tab changed */
bool UI_view2d_tab_set(struct View2D *v2d, int tab);
void UI_view2d_zoom_cache_reset(void);
/* view matrix operations */

View File

@ -1046,53 +1046,6 @@ void UI_view2d_totRect_set(View2D *v2d, int width, int height)
UI_view2d_totRect_set_resize(v2d, width, height, false);
}
bool UI_view2d_tab_set(View2D *v2d, int tab)
{
float default_offset[2] = {0.0f, 0.0f};
float *offset, *new_offset;
bool changed = false;
/* if tab changed, change offset */
if (tab != v2d->tab_cur && v2d->tab_offset) {
if (tab < v2d->tab_num) {
offset = &v2d->tab_offset[tab * 2];
}
else {
offset = default_offset;
}
v2d->cur.xmax += offset[0] - v2d->cur.xmin;
v2d->cur.xmin = offset[0];
v2d->cur.ymin += offset[1] - v2d->cur.ymax;
v2d->cur.ymax = offset[1];
/* validation should happen in subsequent totRect_set */
changed = true;
}
/* resize array if needed */
if (tab >= v2d->tab_num) {
new_offset = MEM_callocN(sizeof(float) * (tab + 1) * 2, "view2d tab offset");
if (v2d->tab_offset) {
memcpy(new_offset, v2d->tab_offset, sizeof(float) * v2d->tab_num * 2);
MEM_freeN(v2d->tab_offset);
}
v2d->tab_offset = new_offset;
v2d->tab_num = tab + 1;
}
/* set current tab and offset */
v2d->tab_cur = tab;
v2d->tab_offset[2 * tab + 0] = v2d->cur.xmin;
v2d->tab_offset[2 * tab + 1] = v2d->cur.ymax;
return changed;
}
void UI_view2d_zoom_cache_reset(void)
{
/* TODO(sergey): This way we avoid threading conflict with sequencer rendering

View File

@ -67,13 +67,6 @@ typedef struct View2D {
/** Pivot point for transforms (rotate and scale). */
short around;
/** Different offset per tab, for buttons. */
float *tab_offset;
/** Number of tabs stored. */
int tab_num;
/** Current tab. */
int tab_cur;
/* Usually set externally (as in, not in view2d files). */
/** Alpha of vertical and horizontal scrollbars (range is [0, 255]). */
char alpha_vert, alpha_hor;