diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-30 20:21:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-30 20:21:35 +0300 |
commit | 8cbd09672d880c4f9774b6b0d1990fc927ae0853 (patch) | |
tree | 67634ad3fec4e466c7356b57968820db03705c71 /source/blender/editors/interface | |
parent | 65e4bfe2f0c233a9df45b620f49a7093e9cc2edf (diff) |
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
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index ec20aa8b55c..dddd6446c0e 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -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 |