Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2004-04-07 18:05:53 +0400
committerTon Roosendaal <ton@blender.org>2004-04-07 18:05:53 +0400
commit774297226bf984f8e6b99bd1ce59a5be2747e995 (patch)
treea63ca2d3204fc6e9063a8d21bee2590cea19bf64 /source/blender/src/interface_panel.c
parent69f2ff45cb3419c4bdb4a6800aefffee64887f6a (diff)
Bug #928
Logic buttons have not been Panelized (will be difficult, dont try!) so the 'Home' and automatic view-limits didn't work it anymore. This caused logic blocks not being accessible by scrolling window. Fixed by updating the code that sets view limits.
Diffstat (limited to 'source/blender/src/interface_panel.c')
-rw-r--r--source/blender/src/interface_panel.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c
index 34839103f91..4e04be7d0fb 100644
--- a/source/blender/src/interface_panel.c
+++ b/source/blender/src/interface_panel.c
@@ -546,10 +546,22 @@ void uiSetPanel_view2d(ScrArea *sa)
G.v2d->tot.ymax= maxy+PNL_DIST;
}
else {
+ uiBlock *block;
+
G.v2d->tot.xmin= 0;
G.v2d->tot.xmax= 1280;
G.v2d->tot.ymin= 0;
G.v2d->tot.ymax= 228;
+
+ /* no panels, but old 'loose' buttons, as in old logic editor */
+ for(block= sa->uiblocks.first; block; block= block->next) {
+ if(block->win==sa->win) {
+ if(block->minx < G.v2d->tot.xmin) G.v2d->tot.xmin= block->minx;
+ if(block->maxx > G.v2d->tot.xmax) G.v2d->tot.xmax= block->maxx;
+ if(block->miny < G.v2d->tot.ymin) G.v2d->tot.ymin= block->miny;
+ if(block->maxy > G.v2d->tot.ymax) G.v2d->tot.ymax= block->maxy;
+ }
+ }
}
}
@@ -558,10 +570,12 @@ void uiSetPanel_view2d(ScrArea *sa)
void uiMatchPanel_view2d(ScrArea *sa)
{
Panel *pa;
+ int done=0;
pa= sa->panels.first;
while(pa) {
if(pa->active) {
+ done= 1;
if(pa->ofsx < G.v2d->tot.xmin) G.v2d->tot.xmin= pa->ofsx;
if(pa->ofsx+pa->sizex > G.v2d->tot.xmax)
G.v2d->tot.xmax= pa->ofsx+pa->sizex;
@@ -570,6 +584,18 @@ void uiMatchPanel_view2d(ScrArea *sa)
G.v2d->tot.ymax= pa->ofsy+pa->sizey+PNL_HEADER;
}
pa= pa->next;
+ }
+ if(done==0) {
+ uiBlock *block;
+ /* no panels, but old 'loose' buttons, as in old logic editor */
+ for(block= sa->uiblocks.first; block; block= block->next) {
+ if(block->win==sa->win) {
+ if(block->minx < G.v2d->tot.xmin) G.v2d->tot.xmin= block->minx;
+ if(block->maxx > G.v2d->tot.xmax) G.v2d->tot.xmax= block->maxx;
+ if(block->miny < G.v2d->tot.ymin) G.v2d->tot.ymin= block->miny;
+ if(block->maxy > G.v2d->tot.ymax) G.v2d->tot.ymax= block->maxy;
+ }
+ }
}
}